diff options
author | dannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-25 00:29:42 +0000 |
---|---|---|
committer | dannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-25 00:29:42 +0000 |
commit | ac48d03e5b0acbc305ac57fb356b466bc04ecdf0 (patch) | |
tree | 0cb7e4ad382ef40b1366d5f251d6999479bde0ac /gcc/cp/search.c | |
parent | e36966203cba9030ffdf3212ce93541c00f8242d (diff) | |
download | gcc-ac48d03e5b0acbc305ac57fb356b466bc04ecdf0.tar.gz |
PR c++/14688
* config/i386/i386.c (ix86_comp_type_attributes): Check
METHOD_TYPE too.
cp
* search.c (check_final_overrider): Fail if
targetm.comp_type_attributes returns 0.
testsuite
* g++.dg/inherit/override_attribs.C: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128740 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r-- | gcc/cp/search.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 4371eb4358e..13e252edd9f 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "rtl.h" #include "output.h" #include "toplev.h" +#include "target.h" static int is_subobject_of_p (tree, tree); static tree dfs_lookup_base (tree, void *); @@ -1901,6 +1902,15 @@ check_final_overrider (tree overrider, tree basefn) return 0; } + /* Check for conflicting type attributes. */ + if (!targetm.comp_type_attributes (over_type, base_type)) + { + error ("conflicting type attributes specified for %q+#D", overrider); + error (" overriding %q+#D", basefn); + DECL_INVALID_OVERRIDER_P (overrider) = 1; + return 0; + } + return 1; } |