aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-11-05 21:44:31 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-11-05 21:44:31 -0400
commite52a5db606c4225c41e77dcfb6e18ebb17b67cac (patch)
treea9feda3bd3bf72594955569b3312cb664468c370 /gcc/cp
parent614122f4d8aa0cb2e3bb4e7ca1e0022567d8b1e2 (diff)
downloadgcc-e52a5db606c4225c41e77dcfb6e18ebb17b67cac.zip
gcc-e52a5db606c4225c41e77dcfb6e18ebb17b67cac.tar.gz
gcc-e52a5db606c4225c41e77dcfb6e18ebb17b67cac.tar.bz2
re PR c++/45473 (ICE: in dfs_walk_once, at cp/search.c:1659)
PR c++/45473 * search.c (look_for_overrides): A constructor is never virtual. From-SVN: r166391
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/search.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 939b05a..cab1040 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/45473
+ * search.c (look_for_overrides): A constructor is never virtual.
+
2010-11-05 Jakub Jelinek <jakub@redhat.com>
PR c++/46160
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 0249fb0..370ddf6 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1935,6 +1935,11 @@ look_for_overrides (tree type, tree fndecl)
int ix;
int found = 0;
+ /* A constructor for a class T does not override a function T
+ in a base class. */
+ if (DECL_CONSTRUCTOR_P (fndecl))
+ return 0;
+
for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
{
tree basetype = BINFO_TYPE (base_binfo);