Commit 89a249f2 by Marek Polacek Committed by Marek Polacek

PR c++/88373 - wrong parse error with ~.

	* parser.c (cp_parser_template_name): Check tag_type for
	none_type.

	* g++.dg/cpp2a/fn-template19.C: New test.

From-SVN: r266865
parent c438ab79
2018-12-06 Marek Polacek <polacek@redhat.com>
PR c++/88373 - wrong parse error with ~.
* parser.c (cp_parser_template_name): Check tag_type for
none_type.
2018-12-06 Segher Boessenkool <segher@kernel.crashing.org> 2018-12-06 Segher Boessenkool <segher@kernel.crashing.org>
* cp-tree.h (finish_asm_stmt): Update declaration. * cp-tree.h (finish_asm_stmt): Update declaration.
......
...@@ -16579,7 +16579,8 @@ cp_parser_template_name (cp_parser* parser, ...@@ -16579,7 +16579,8 @@ cp_parser_template_name (cp_parser* parser,
if (!found if (!found
&& (cxx_dialect > cxx17) && (cxx_dialect > cxx17)
&& !scoped_p && !scoped_p
&& cp_lexer_next_token_is (parser->lexer, CPP_LESS)) && cp_lexer_next_token_is (parser->lexer, CPP_LESS)
&& tag_type == none_type)
{ {
/* [temp.names] says "A name is also considered to refer to a template /* [temp.names] says "A name is also considered to refer to a template
if it is an unqualified-id followed by a < and name lookup finds if it is an unqualified-id followed by a < and name lookup finds
2018-12-06 Marek Polacek <polacek@redhat.com>
PR c++/88373 - wrong parse error with ~.
* g++.dg/cpp2a/fn-template19.C: New test.
2018-12-06 Richard Sandiford <richard.sandiford@arm.com> 2018-12-06 Richard Sandiford <richard.sandiford@arm.com>
* gcc.dg/vect/vect-over-widen-23.c: Remove unwanted line. * gcc.dg/vect/vect-over-widen-23.c: Remove unwanted line.
......
// PR c++/88373
// { dg-do compile }
// { dg-options "-std=c++2a" }
template <class T>
constexpr T value = T {};
template <class T, T t>
struct S {};
using U = S <int, ~value <int>>;
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