[libcxx-commits] [clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

Krystian Stasiowski via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 1 11:29:53 PDT 2024


================
@@ -1779,6 +1779,42 @@ void Parser::checkPotentialAngleBracket(ExprResult &PotentialTemplateName) {
                     Priority);
 }
 
+bool Parser::isMissingTemplateKeywordBeforeScope(bool AnnotateInvalid) {
+  assert(Tok.is(tok::coloncolon));
+  Sema::DisableTypoCorrectionRAII DTC(Actions);
+  ColonProtectionRAIIObject ColonProtection(*this);
+
+  SourceLocation StartLoc = Tok.getLocation();
+  if (TryAnnotateTypeOrScopeToken())
+    return true;
+  if (Tok.isSimpleTypeSpecifier(getLangOpts()))
+    return false;
+  CXXScopeSpec SS;
+  ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/nullptr,
+                                 /*ObjectHasErrors=*/false,
+                                 /*EnteringContext=*/false);
+  ExprResult Result = tryParseCXXIdExpression(SS, /*isAddressOfOperand=*/false);
----------------
sdkrystian wrote:

@zygoloid Do you otherwise think that it's reasonable to apply this change to _all_ C++ language modes (given the existence of [this thread](https://lists.isocpp.org/core/2024/07/16028.php) on the core reflector resulting from the initial application of this patch _without_ the enhanced identification of missing `template`)? 

https://github.com/llvm/llvm-project/pull/100425


More information about the libcxx-commits mailing list