aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/cp/semantics.c1
4 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fa7a1a0..0bdbf3c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2015-05-11 Jan Hubicka <hubicka@ucw.cz>
+
+ * class.c (fixup_type_variants): Do not copy TYPE_METHODS
+ (one_inheriting_sig): Assert tat we always set TYPE_METHODS of main variant.
+ * semantics.c (finish_member_declaration): Likewise.
+ * method.c (lazily_declare_fn): Allways add method to main variant list.
+
2015-05-09 Aldy Hernandez <aldyh@redhat.com>
PR bootstrap/66085
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index c1548a0..4160705 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1972,7 +1972,6 @@ fixup_type_variants (tree t)
/* Copy whatever these are holding today. */
TYPE_VFIELD (variants) = TYPE_VFIELD (t);
- TYPE_METHODS (variants) = TYPE_METHODS (t);
TYPE_FIELDS (variants) = TYPE_FIELDS (t);
}
}
@@ -3238,6 +3237,7 @@ one_inheriting_sig (tree t, tree ctor, tree *parms, int nparms)
parmlist = tree_cons (NULL_TREE, parms[i], parmlist);
tree fn = implicitly_declare_fn (sfk_inheriting_constructor,
t, false, ctor, parmlist);
+ gcc_assert (TYPE_MAIN_VARIANT (t) == t);
if (add_method (t, fn, NULL_TREE))
{
DECL_CHAIN (fn) = TYPE_METHODS (t);
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 81f50e6..d41e112 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -2139,6 +2139,8 @@ lazily_declare_fn (special_function_kind sfk, tree type)
/* Whether or not the argument has a const reference type. */
bool const_p = false;
+ type = TYPE_MAIN_VARIANT (type);
+
switch (sfk)
{
case sfk_constructor:
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 701a8eb..e1d18fb 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2913,6 +2913,7 @@ finish_member_declaration (tree decl)
CLASSTYPE_METHOD_VEC. */
if (add_method (current_class_type, decl, NULL_TREE))
{
+ gcc_assert (TYPE_MAIN_VARIANT (current_class_type) == current_class_type);
DECL_CHAIN (decl) = TYPE_METHODS (current_class_type);
TYPE_METHODS (current_class_type) = decl;