]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Fox template-introduction tentative parsing in class bodies clear colon_corrects...
authorJakub Jelinek <jakub@redhat.com>
Wed, 30 Mar 2022 07:16:41 +0000 (09:16 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 30 Mar 2022 07:18:30 +0000 (09:18 +0200)
commit7b5a2b6e4f78395962835790c6d4a3e27ab8d378
tree5bf60b7de47e974a8623c3ea39d17b4e26e53d3e
parent461ecdba3664161519a6caa4d3eab6af5ef7afd7
c++: Fox template-introduction tentative parsing in class bodies clear colon_corrects_to_scope_p [PR105061]

The concepts support (in particular template introductions from concepts TS)
broke the following testcase, valid unnamed bitfields with dependent
types (or even just typedefs) were diagnosed as typos (: instead of correct
::) in template introduction during their tentative parsing.
The following patch fixes that by not doing this : to :: correction when
member_p is true.

2022-03-30  Jakub Jelinek  <jakub@redhat.com>

PR c++/105061
* parser.c (cp_parser_template_introduction): If member_p, temporarily
clear parser->colon_corrects_to_scope_p around tentative parsing of
nested name specifier.

* g++.dg/concepts/pr105061.C: New test.

(cherry picked from commit 4f2795218a6ba6a7b7b9b18ca7a6e390661e1608)
gcc/cp/parser.c
gcc/testsuite/g++.dg/concepts/pr105061.C [new file with mode: 0644]