aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-09-21 08:55:15 -0700
committerNathan Sidwell <nathan@acm.org>2020-09-21 11:53:14 -0700
commit33605e9bef15555b19f06424ea0b777b5fdc0dfa (patch)
tree4dfd124ac2f9b0f3e404605ac5223cb8eea2f061 /gcc/cp/decl.c
parent4f5a297f7520cf5ba10a3a16f32ea0e1655b203f (diff)
downloadgcc-33605e9bef15555b19f06424ea0b777b5fdc0dfa.zip
gcc-33605e9bef15555b19f06424ea0b777b5fdc0dfa.tar.gz
gcc-33605e9bef15555b19f06424ea0b777b5fdc0dfa.tar.bz2
c++: ts_lambda is not needed
We don't need ts_lambda, as IDENTIFIER_LAMBDA_P is sufficient. Killed thusly. gcc/cp/ * decl.c (xref_tag_1): Use IDENTIFIER_LAMBDA_P to detect lambdas. * lambda.c (begin_lambda_type): Use ts_current to push the tag. * name-lookup.h (enum tag_scope): Drop ts_lambda.
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index af79649..bbecebe 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -14857,10 +14857,10 @@ check_elaborated_type_specifier (enum tag_types tag_code,
return type;
}
-/* Lookup NAME in elaborate type specifier in scope according to
- SCOPE and issue diagnostics if necessary.
- Return *_TYPE node upon success, NULL_TREE when the NAME is not
- found, and ERROR_MARK_NODE for type error. */
+/* Lookup NAME of an elaborated type specifier according to SCOPE and
+ issue diagnostics if necessary. Return *_TYPE node upon success,
+ NULL_TREE when the NAME is not found, and ERROR_MARK_NODE for type
+ error. */
static tree
lookup_and_check_tag (enum tag_types tag_code, tree name,
@@ -14997,9 +14997,9 @@ xref_tag_1 (enum tag_types tag_code, tree name,
/* In case of anonymous name, xref_tag is only called to
make type node and push name. Name lookup is not required. */
tree t = NULL_TREE;
- if (scope != ts_lambda && !IDENTIFIER_ANON_P (name))
+ if (!IDENTIFIER_ANON_P (name))
t = lookup_and_check_tag (tag_code, name, scope, template_header_p);
-
+
if (t == error_mark_node)
return error_mark_node;
@@ -15052,19 +15052,14 @@ xref_tag_1 (enum tag_types tag_code, tree name,
error ("use of enum %q#D without previous declaration", name);
return error_mark_node;
}
- else
- {
- t = make_class_type (code);
- TYPE_CONTEXT (t) = context;
- if (scope == ts_lambda)
- {
- /* Mark it as a lambda type. */
- CLASSTYPE_LAMBDA_EXPR (t) = error_mark_node;
- /* And push it into current scope. */
- scope = ts_current;
- }
- t = pushtag (name, t, scope);
- }
+
+ t = make_class_type (code);
+ TYPE_CONTEXT (t) = context;
+ if (IDENTIFIER_LAMBDA_P (name))
+ /* Mark it as a lambda type right now. Our caller will
+ correct the value. */
+ CLASSTYPE_LAMBDA_EXPR (t) = error_mark_node;
+ t = pushtag (name, t, scope);
}
else
{