aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-05-11 14:40:28 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-05-11 14:40:28 +0000
commitc443f3d51e4b8ff0298d1cacff67b2632e8a9264 (patch)
tree64635e53ccf16b81688d5555d8ea53c39e561ed4 /gcc/cp/decl.c
parent2cd470921f6e8297cab3fbfbaa102e7245e660d6 (diff)
downloadgcc-c443f3d51e4b8ff0298d1cacff67b2632e8a9264.zip
gcc-c443f3d51e4b8ff0298d1cacff67b2632e8a9264.tar.gz
gcc-c443f3d51e4b8ff0298d1cacff67b2632e8a9264.tar.bz2
decl.c (xref_tag_1): Don't frob ts_lambda scope here.
* decl.c (xref_tag_1): Don't frob ts_lambda scope here. * name-lookup.c (pushtag_1): Deal with ts_lambda scope. From-SVN: r247909
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9291b96..44276cc 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13514,12 +13514,10 @@ lookup_and_check_tag (enum tag_types tag_code, tree name,
static tree
xref_tag_1 (enum tag_types tag_code, tree name,
- tag_scope orig_scope, bool template_header_p)
+ tag_scope scope, bool template_header_p)
{
enum tree_code code;
- tree t;
tree context = NULL_TREE;
- tag_scope scope;
gcc_assert (identifier_p (name));
@@ -13539,19 +13537,12 @@ xref_tag_1 (enum tag_types tag_code, tree name,
gcc_unreachable ();
}
- if (orig_scope == ts_lambda)
- scope = ts_current;
- else
- scope = orig_scope;
-
/* In case of anonymous name, xref_tag is only called to
make type node and push name. Name lookup is not required. */
- if (anon_aggrname_p (name))
- t = NULL_TREE;
- else
- t = lookup_and_check_tag (tag_code, name,
- scope, template_header_p);
-
+ tree t = NULL_TREE;
+ if (scope != ts_lambda && !anon_aggrname_p (name))
+ t = lookup_and_check_tag (tag_code, name, scope, template_header_p);
+
if (t == error_mark_node)
return error_mark_node;
@@ -13617,9 +13608,8 @@ xref_tag_1 (enum tag_types tag_code, tree name,
{
t = make_class_type (code);
TYPE_CONTEXT (t) = context;
- if (orig_scope == ts_lambda)
- /* Remember that we're declaring a lambda to avoid bogus errors
- in push_template_decl. */
+ if (scope == ts_lambda)
+ /* Mark it as a lambda type. */
CLASSTYPE_LAMBDA_EXPR (t) = error_mark_node;
t = pushtag (name, t, scope);
}