diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index a5cbb3e896f..5fa743b5a8e 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -33224,7 +33224,6 @@ cp_parser_next_token_ends_template_argument_p (cp_parser *parser) || ((cxx_dialect != cxx98) && token->type == CPP_RSHIFT) /* For better diagnostics, treat >>= like that too, that shouldn't appear non-nested in template arguments. */ - || token->type == CPP_GREATER_EQ || token->type == CPP_RSHIFT_EQ); } diff --git a/gcc/testsuite/g++.dg/parse/template31.C b/gcc/testsuite/g++.dg/parse/template31.C new file mode 100644 index 00000000000..a5693e851f7 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/template31.C @@ -0,0 +1,4 @@ +// PR c++/105436 + +template struct A; +template A= 5> f();