Commit d966b274 by Jason Merrill Committed by Jason Merrill

re PR c++/57471 (Bizarre error for template parameter pack)

	PR c++/57471
	* parser.c (cp_parser_sizeof_pack): Clear parser scopes.

From-SVN: r200852
parent 7da38058
2013-07-09 Jason Merrill <jason@redhat.com>
PR c++/57471
* parser.c (cp_parser_sizeof_pack): Clear parser scopes.
PR c++/57658
* semantics.c (finish_id_expression): Return the id for an
unevaluated outer variable.
......
......@@ -23136,6 +23136,10 @@ cp_parser_sizeof_pack (cp_parser *parser)
cp_token *token = cp_lexer_peek_token (parser->lexer);
tree name = cp_parser_identifier (parser);
/* The name is not qualified. */
parser->scope = NULL_TREE;
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
tree expr = cp_parser_lookup_name_simple (parser, name, token->location);
if (expr == error_mark_node)
cp_parser_name_lookup_error (parser, name, expr, NLE_NULL,
......
// PR c++/57471
// { dg-require-effective-target c++11 }
struct A
{
static constexpr bool value = true;
};
template<typename... Types>
struct B
{
static_assert(A::value, "");
static_assert(sizeof...(Types) == 0, "");
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment