[clang] [clang][ObjectiveC] Fix Parsing Method Parameter Types with the `::` Prefix (PR #119908)

Cyndy Ishida via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 17 08:00:38 PST 2024


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

I'm wondering if it's valid for C code to enter this block, iow, can we remove the `getLangOpts().ObjC` check? 
I notice a similar check in  https://github.com/llvm/llvm-project/blob/ec903eb3fcd18ba53af901582060bd61b13cf324/clang/lib/Parse/Parser.cpp#L2170 that also looks added to resolve a hang. 

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


More information about the cfe-commits mailing list