https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127945
Bug ID: 127945
Summary: g++.dg/cpp26/literals1.C and literals2.C: { target
c++23 } selectors silently ignored (missing comment
argument)
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: testsuite
Assignee: unassigned at gcc dot gnu.org
Reporter: dmalcolm at gcc dot gnu.org
Target Milestone: ---
I'm experimenting with a new test for dg-lint (see bug 127943), which caught a
couple of suspicious-looking DejaGnu directives added in
g:194825f20619a1c4b51eaea84f20432fefc0db03.
// g++.dg/cpp26/literals1.C:22
char16_t n = u'\N{FACE WITH TEARS OF JOY}'; // { dg-error "character not
encodable in a single code unit" { target c++23 } }
// g++.dg/cpp26/literals2.C:24
char16_t n = u'\N{FACE WITH TEARS OF JOY}'; // { dg-error "character not
encodable in a single code unit" { target c++23 } }
The "{ target c++23 }" fragments in the comment look like target selectors, but
the directives are missing a "" comment, so I believe DejaGnu parses this part
of the C++ comments as comments, not selectors. Hence, misleadingly, the
directives are checked on every C++ version.
Claude Code reckons that the error is, in fact, emitted on every C++ version,
so the best fix might be to simply delete these "selectors".
Checked on ce4b6019b8758b04a8733bc672adbbaa384c752a.