]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: -Wno-abbreviated-auto-in-template-arg [PR120917]
authorJason Merrill <jason@redhat.com>
Wed, 2 Jul 2025 09:15:01 +0000 (05:15 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 7 Jul 2025 14:36:31 +0000 (10:36 -0400)
commit8abc2e66be72a34db8c3cc97e4fbd90b7abae61d
treea55b387596f73238540f131502155627f6610242
parent0c73f2f1f92c135f50dcc2ab76d5e53236262a4e
c++: -Wno-abbreviated-auto-in-template-arg [PR120917]

In r14-1659 I added a missing error for a Concepts TS feature that we were
failing to diagnose, but this PR requests a way to disable that error for
code written thinking it was valid.  Which seems reasonable, since it
doesn't require any work beyond that and is a plausible extension by itself.

While looking at this, I also noticed we were still not giving the
diagnostic in a few cases, and fixing that affected a few of our old
concepts testcases.

PR c++/120917

gcc/ChangeLog:

* doc/invoke.texi: Add -Wno-abbreviated-auto-in-template-arg.

gcc/c-family/ChangeLog:

* c.opt: Add -Wno-abbreviated-auto-in-template-arg.
* c.opt.urls: Regenerate.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_simple_type_specifier): Attach
auto in targ in parameter to -Wabbreviated-auto-in-template-arg.
(cp_parser_placeholder_type_specifier): Diagnose constrained auto in
template arg.

gcc/testsuite/ChangeLog:

* g++.dg/concepts/auto7a.C: Add diagnostic.
* g++.dg/concepts/auto7b.C: New test.
* g++.dg/concepts/auto7c.C: New test.
* g++.dg/cpp1y/pr85076.C: Expect 'auto' error.
* g++.dg/concepts/pr67249.C: Likewise.
* g++.dg/cpp1y/lambda-generic-variadic.C: Likewise.
* g++.dg/cpp2a/concepts-pr67210.C: Likewise.
* g++.dg/concepts/pr67249a.C: New test.
* g++.dg/cpp1y/lambda-generic-variadic-a.C: New test.
* g++.dg/cpp2a/concepts-pr67210a.C: New test.
14 files changed:
gcc/c-family/c.opt
gcc/c-family/c.opt.urls
gcc/cp/parser.cc
gcc/doc/invoke.texi
gcc/testsuite/g++.dg/concepts/auto7a.C
gcc/testsuite/g++.dg/concepts/auto7b.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/auto7c.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr67249.C
gcc/testsuite/g++.dg/concepts/pr67249a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic-a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic.C
gcc/testsuite/g++.dg/cpp1y/pr85076.C
gcc/testsuite/g++.dg/cpp2a/concepts-pr67210.C
gcc/testsuite/g++.dg/cpp2a/concepts-pr67210a.C [new file with mode: 0644]