c++: unroll pragma in templates [PR111529]
commit9c62af101e11e1cce573c2b3d2e18b403412dbc8
authorJason Merrill <jason@redhat.com>
Fri, 22 Sep 2023 11:10:11 +0000 (22 12:10 +0100)
committerJason Merrill <jason@redhat.com>
Fri, 22 Sep 2023 13:00:05 +0000 (22 14:00 +0100)
tree40172974d61a22eb8b507eef7a71c9a2f78b95b9
parent4c496020764057453415f1ae599950724ec0e871
c++: unroll pragma in templates [PR111529]

We were failing to handle ANNOTATE_EXPR in tsubst_copy_and_build, leading to
problems with substitution of any wrapped expressions.

Let's also not tell users that lambda templates are available in C++14.

PR c++/111529

gcc/cp/ChangeLog:

* parser.cc (cp_parser_lambda_declarator_opt): Don't suggest
-std=c++14 for lambda templates.
* pt.cc (tsubst_expr): Move ANNOTATE_EXPR handling...
(tsubst_copy_and_build): ...here.

gcc/testsuite/ChangeLog:

* g++.dg/ext/unroll-4.C: New test.
gcc/cp/parser.cc
gcc/cp/pt.cc
gcc/testsuite/g++.dg/ext/unroll-4.C [new file with mode: 0644]