diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2007-09-25 00:29:42 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@gcc.gnu.org> | 2007-09-25 00:29:42 +0000 |
commit | 18ff3013c2600a5138fbd51d5a90af1d3101ce1d (patch) | |
tree | 0cb7e4ad382ef40b1366d5f251d6999479bde0ac /gcc/cp | |
parent | 2e104885214d399548cd5742e5b818cd63c02dbf (diff) | |
download | gcc-18ff3013c2600a5138fbd51d5a90af1d3101ce1d.zip gcc-18ff3013c2600a5138fbd51d5a90af1d3101ce1d.tar.gz gcc-18ff3013c2600a5138fbd51d5a90af1d3101ce1d.tar.bz2 |
re PR c++/14688 (Mis-matched calling convention on virtual functions accepted without error)
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.
From-SVN: r128740
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/search.c | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6950166..0effc4b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2007-09-24 Danny Smith <dannysmith@user.sourceforge.net> + + PR c++/14688 + * search.c (check_final_overrider): Fail if + targetm.comp_type_attributes returns 0. + + 2007-09-24 Jason Merrill <jason@redhat.com> PR c++/33239 diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 4371eb4..13e252e 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; } |