diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2010-12-25 10:41:05 +0000 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2010-12-25 11:41:05 +0100 |
commit | bc30fc12b1cbcd1942d93b5e555a1ed7195a73b8 (patch) | |
tree | 9f680cb91b3919a11678abcf4c45c694eacfbcdc /gcc/cp | |
parent | 784904958d6975247ad57ec2df72a8775b2b3efb (diff) | |
download | gcc-bc30fc12b1cbcd1942d93b5e555a1ed7195a73b8.zip gcc-bc30fc12b1cbcd1942d93b5e555a1ed7195a73b8.tar.gz gcc-bc30fc12b1cbcd1942d93b5e555a1ed7195a73b8.tar.bz2 |
re PR c++/15774 (Conflicting function decls not diagnosed)
2010-12-25 Kai Tietz <kai.tietz@onevision.com>
PR c++/15774
* decl.c (decls_match): Check for FUNCTION_DECL
also for identity of compatible attributes.
ChangeLog gcc/testsuite
2010-12-25 Kai Tietz <kai.tietz@onevision.com>
PR c++/15774
* g++.dg/warn/pr15774-1.C: New test.
* g++.dg/warn/pr15774-2.C: New test.
From-SVN: r168241
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5bdfa43..09e4353 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-12-25 Kai Tietz <kai.tietz@onevision.com> + + PR c++/15774 + * decl.c (decls_match): Check for FUNCTION_DECL + also for identity of compatible attributes. + 2010-12-22 Nathan Froyd <froydnj@codesourcery.com> * decl.c (decls_match, duplicate_decls): Use prototype_p. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f74b0c2..f7bf1bf 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1009,7 +1009,11 @@ decls_match (tree newdecl, tree olddecl) } #endif else - types_match = compparms (p1, p2); + types_match = + compparms (p1, p2) + && (TYPE_ATTRIBUTES (TREE_TYPE (newdecl)) == NULL_TREE + || targetm.comp_type_attributes (TREE_TYPE (newdecl), + TREE_TYPE (olddecl)) != 0); } else types_match = 0; |