[clang] [clang][ObjectiveC] Fix Parsing Types with the `::` Optional Scope Specifier (PR #119908)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 17 15:23:11 PST 2024


================
@@ -2222,8 +2222,15 @@ bool Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(
     }
   }
 
-  if (SS.isEmpty())
+  if (SS.isEmpty()) {
+    if (getLangOpts().ObjC && !getLangOpts().CPlusPlus &&
----------------
qiongsiwu wrote:

Good question. The reason I added the guard for Objective C is a test case failure if we only rule out `CPlusPlus`. This test case https://github.com/qiongsiwu/llvm-project/blob/139e69b7bcb05e6ff9db0f373d9180deb341a571/clang/test/ParserOpenACC/parse-clauses.c#L436 uses `::` for OpenACC. 

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


More information about the cfe-commits mailing list