diff options
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f9331bc..f74b0c2 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -983,7 +983,7 @@ decls_match (tree newdecl, tree olddecl) if (same_type_p (TREE_TYPE (f1), TREE_TYPE (f2))) { - if (p2 == NULL_TREE && DECL_EXTERN_C_P (olddecl) + if (!prototype_p (f2) && DECL_EXTERN_C_P (olddecl) && (DECL_BUILT_IN (olddecl) #ifndef NO_IMPLICIT_EXTERN_C || (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl)) @@ -996,7 +996,7 @@ decls_match (tree newdecl, tree olddecl) TREE_TYPE (newdecl) = TREE_TYPE (olddecl); } #ifndef NO_IMPLICIT_EXTERN_C - else if (p1 == NULL_TREE + else if (!prototype_p (f1) && (DECL_EXTERN_C_P (olddecl) && DECL_IN_SYSTEM_HEADER (olddecl) && !DECL_CLASS_SCOPE_P (olddecl)) @@ -1536,8 +1536,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) } else if (TREE_CODE (olddecl) == FUNCTION_DECL && DECL_INITIAL (olddecl) != NULL_TREE - && TYPE_ARG_TYPES (TREE_TYPE (olddecl)) == NULL_TREE - && TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != NULL_TREE) + && !prototype_p (TREE_TYPE (olddecl)) + && prototype_p (TREE_TYPE (newdecl))) { /* Prototype decl follows defn w/o prototype. */ warning_at (input_location, 0, "prototype for %q+#D", newdecl); |