tree saved_scope = parser->scope;
tree saved_object_scope = parser->object_scope;
tree saved_qualifying_scope = parser->qualifying_scope;
+ bool saved_colon_corrects_to_scope_p = parser->colon_corrects_to_scope_p;
cp_token *start_token = cp_lexer_peek_token (parser->lexer);
+ /* In classes don't parse valid unnamed bitfields as invalid
+ template introductions. */
+ if (member_p)
+ parser->colon_corrects_to_scope_p = false;
+
/* Look for the optional `::' operator. */
cp_parser_global_scope_opt (parser,
/*current_scope_valid_p=*/false);
parser->scope = saved_scope;
parser->object_scope = saved_object_scope;
parser->qualifying_scope = saved_qualifying_scope;
+ parser->colon_corrects_to_scope_p = saved_colon_corrects_to_scope_p;
if (concept_name == error_mark_node
|| (seen_error () && !concept_definition_p (tmpl_decl)))
--- /dev/null
+// PR c++/105061
+
+template <typename T, int U, int V>
+struct A { T : V, u : U; };
+template <int U, int V>
+struct B { unsigned : V, u : U; };
+typedef unsigned uns;
+template <int U, int V>
+struct C { uns : V, u : U; };
+
+A<unsigned int, 4, 5> a = { 13 };
+B<5, 6> b = { 26 };
+C<8, 9> c = { 42 };