aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r--gcc/cp/lex.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index db8fdd50db2..d9f2262f69d 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -2869,6 +2869,14 @@ do_identifier (token, parsing, args)
|| TREE_CODE (field) == CONST_DECL
|| TREE_CODE (field) == TEMPLATE_DECL)
id = field;
+ else if (TREE_CODE (field) == TYPE_DECL
+ && DECL_ARTIFICIAL (field)
+ && IMPLICIT_TYPENAME_P (TREE_TYPE (field)))
+ /* When we did name-lookup before, we will have eschewed
+ implicit typenames in favor of global bindings. Therefore,
+ if lookup_field returns an implicit typename, but ID is not
+ an implicit typename, then we should skip this one, too. */
+ ;
else if (TREE_CODE (field) != FIELD_DECL)
my_friendly_abort (61);
else
@@ -4674,7 +4682,6 @@ make_lang_type (code)
TYPE_LANG_SPECIFIC (t) = pi;
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
- TYPE_BINFO (t) = make_binfo (integer_zero_node, t, NULL_TREE, NULL_TREE);
/* Make sure this is laid out, for ease of use later. In the
presence of parse errors, the normal was of assuring this
@@ -4692,6 +4699,13 @@ make_lang_type (code)
clear it here. */
TYPE_ALIAS_SET (t) = 0;
+ /* We need to allocate a TYPE_BINFO even for TEMPALTE_TYPE_PARMs
+ since they can be virtual base types, and we then need a
+ canonical binfo for them. Ideally, this would be done lazily for
+ all types. */
+ if (IS_AGGR_TYPE_CODE (code) || code == TEMPLATE_TYPE_PARM)
+ TYPE_BINFO (t) = make_binfo (integer_zero_node, t, NULL_TREE, NULL_TREE);
+
return t;
}