Skip to content

Commit de51559

Browse files
committed
[Concepts] Fix incorrect recovery in TryAnnotateTypeConstraint
TryAnnotateTypeConstraint would not put the scope specifier back into the token stream when faced with a non-concept name after a scope specifier.
1 parent 3a906a9 commit de51559

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/Parse/ParseTemplate.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,11 @@ bool Parser::TryAnnotateTypeConstraint() {
712712
MemberOfUnknownSpecialization);
713713
assert(!MemberOfUnknownSpecialization
714714
&& "Member when we only allowed namespace scope qualifiers??");
715-
if (!PossibleConcept || TNK != TNK_Concept_template)
715+
if (!PossibleConcept || TNK != TNK_Concept_template) {
716+
if (SS.isNotEmpty())
717+
AnnotateScopeToken(SS, !WasScopeAnnotation);
716718
return false;
719+
}
717720

718721
// At this point we're sure we're dealing with a constrained parameter. It
719722
// may or may not have a template parameter list following the concept

0 commit comments

Comments
 (0)