aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/gnu/java
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2026-02-11 15:58:46 -0500
committerMarek Polacek <polacek@redhat.com>2026-02-12 08:31:58 -0500
commit4b12cc841f32903c0d53dd973d703f0722b23cf3 (patch)
tree28f465823a4834271129df2d8e658187c6bb5af6 /libjava/classpath/gnu/java
parent3593e79a9fbe4266589cb5408cf47583a2cb1ca1 (diff)
downloadgcc-4b12cc841f32903c0d53dd973d703f0722b23cf3.zip
gcc-4b12cc841f32903c0d53dd973d703f0722b23cf3.tar.gz
gcc-4b12cc841f32903c0d53dd973d703f0722b23cf3.tar.bz2
c++: missing type-only context [PR124045]
[temp.res.general]/4.4.1 says that a decl-specifier of the decl-specifier-seq of a simple-declaration in namespace scope is a type-only context. I think this goes back to P0634R3. So [: ^^int :] a = 42; shouldn't require a 'typename' when in a namespace scope. The _diagnose_invalid_type_name change is so that we don't emit extra error: '<expression error>' in '...' does not name a type in concepts-return-req4.C, variadic74.C, and variadic-nested3.C. PR c++/124045 gcc/cp/ChangeLog: * parser.cc (cp_parser_parse_and_diagnose_invalid_type_name): Also abort the tentative parse when id is error_mark_node. (cp_parser_simple_declaration): Set CP_PARSER_FLAGS_TYPENAME_OPTIONAL when in a namespace scope. (cp_parser_single_declaration): Use cp_parser_flags instead of int. gcc/testsuite/ChangeLog: * g++.dg/reflect/type1.C: Don't expect an error for a missing typename in a namespace scope. Reviewed-by: Patrick Palka <ppalka@redhat.com> Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libjava/classpath/gnu/java')
0 files changed, 0 insertions, 0 deletions