Skip to content
Snippets Groups Projects
Commit d3e2a174 authored by Jason Merrill's avatar Jason Merrill
Browse files

c++: diagnose auto in template arg

We were failing to diagnose this Concepts TS feature that didn't make it
into C++20 because the 'auto' was getting converted to a template parameter
before we checked for it.  So also check in cp_parser_simple_type_specifier.

The code in cp_parser_template_type_arg that I initially expected to
diagnose this seems unreachable because cp_parser_type_id_1 already checks
auto.

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_simple_type_specifier): Check for auto
	in template argument.
	(cp_parser_template_type_arg): Remove auto checking.

gcc/testsuite/ChangeLog:

	* g++.dg/concepts/auto7.C: New test.
	* g++.dg/concepts/auto7a.C: New test.
parent 35d2c40e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment