Index: clang/lib/Parse/ParseExprCXX.cpp =================================================================== --- clang/lib/Parse/ParseExprCXX.cpp +++ clang/lib/Parse/ParseExprCXX.cpp @@ -3589,7 +3589,7 @@ // We need to consume the typename to allow 'requires { typename a; }' SourceLocation TypenameKWLoc = ConsumeToken(); - if (TryAnnotateCXXScopeToken()) { + if (TryAnnotateOptionalCXXScopeToken()) { TPA.Commit(); SkipUntil(tok::semi, tok::r_brace, SkipUntilFlags::StopBeforeMatch); break; Index: clang/test/Parser/cxx2a-concepts-requires-expr.cpp =================================================================== --- clang/test/Parser/cxx2a-concepts-requires-expr.cpp +++ clang/test/Parser/cxx2a-concepts-requires-expr.cpp @@ -144,3 +144,18 @@ bool r41 = requires { requires (); }; // expected-error@-1 {{expected expression}} + +bool r42 = requires { typename long; }; // expected-error {{expected a qualified name after 'typename'}} + +template +requires requires { + typename _BitInt(N); // expected-error {{expected a qualified name after 'typename'}} +} using r43 = void; + +template +using BitInt = _BitInt(N); + +template +requires requires { + typename BitInt; // ok +} using r44 = void;