diff options
author | Saar Raz <saar@raz.email> | 2020-03-17 01:43:29 +0200 |
---|---|---|
committer | Saar Raz <saar@raz.email> | 2020-03-17 07:49:42 +0200 |
commit | 135744ce689569e7c64033bb5812572d3000239b (patch) | |
tree | ccfefa0559c17dd2b1ea367182b84f97622ac54a /clang/lib/Parse/ParseTemplate.cpp | |
parent | 9e0bd5ec03cbc8d53048e92ddf7fd25bca17e912 (diff) | |
download | bcm5719-llvm-135744ce689569e7c64033bb5812572d3000239b.tar.gz bcm5719-llvm-135744ce689569e7c64033bb5812572d3000239b.zip |
[Concepts] Fix incorrect control flow when TryAnnotateTypeConstraint annotates an invalid template-id
TryAnnotateTypeConstraint could annotate a template-id which doesn't end up being a type-constraint,
in which case control flow would incorrectly flow into ParseImplicitInt.
Reenter the loop in this case.
Enable relevant tests for C++20. This required disabling typo-correction during TryAnnotateTypeConstraint
and changing a test case which is broken due to a separate bug (will be reported and handled separately).
(cherry picked from commit 19fccc52ff2c1da1f93d9317c34769bd9bab8ac8)
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | clang/lib/Parse/ParseTemplate.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index 3bc4e3596f1..609640576e9 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -710,7 +710,8 @@ bool Parser::TryAnnotateTypeConstraint() { /*ObjectType=*/ParsedType(), /*EnteringContext=*/false, PossibleConcept, - MemberOfUnknownSpecialization); + MemberOfUnknownSpecialization, + /*Disambiguation=*/true); if (MemberOfUnknownSpecialization || !PossibleConcept || TNK != TNK_Concept_template) { if (SS.isNotEmpty()) |