diff options
author | Jason Merrill <jason@redhat.com> | 2017-02-17 17:05:18 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2017-02-17 17:05:18 -0500 |
commit | cb94c7007c6375f7e6752e0426a5ea0e3f046c47 (patch) | |
tree | 48e0bf87fd08ee4a5757de2c8610fa634410975a /gcc/cp/parser.c | |
parent | 7c5867495bbfce161cd0461b002f626f9339b78f (diff) | |
download | gcc-cb94c7007c6375f7e6752e0426a5ea0e3f046c47.zip gcc-cb94c7007c6375f7e6752e0426a5ea0e3f046c47.tar.gz gcc-cb94c7007c6375f7e6752e0426a5ea0e3f046c47.tar.bz2 |
PR c++/79508 - lookup error with member template
* parser.c (cp_parser_template_name): Clear
parser->context->object_type if we aren't doing lookup.
From-SVN: r245553
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 060962d..92d8cce 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15719,6 +15719,7 @@ cp_parser_template_name (cp_parser* parser, cp_lexer_purge_tokens_after (parser->lexer, start); if (is_identifier) *is_identifier = true; + parser->context->object_type = NULL_TREE; return identifier; } @@ -15730,7 +15731,12 @@ cp_parser_template_name (cp_parser* parser, && (!parser->scope || (TYPE_P (parser->scope) && dependent_type_p (parser->scope)))) - return identifier; + { + /* We're optimizing away the call to cp_parser_lookup_name, but we + still need to do this. */ + parser->context->object_type = NULL_TREE; + return identifier; + } } /* Look up the name. */ |