[clang] [clang][HIP][CUDA] Disambiguate lambdas from Microsoft attributes (PR #214247)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 7 09:23:23 PDT 2026


================
@@ -748,6 +748,33 @@ ExprResult Parser::TryParseLambdaExpression() {
   return ParseLambdaExpressionAfterIntroducer(Intro);
 }
 
+bool Parser::startsLambdaNotMicrosoftAttribute() {
+  // Restricted to CUDA/HIP.
+  if (!getLangOpts().CUDA || Tok.isNot(tok::l_square))
----------------
erichkeane wrote:

This doesn't seem right, why is this cuda specific?  How do we handle this for NON cuda situations?  These lambdas aren't really any different than 'normal' lambdas, right?  

SO the fact that we have similar disembiguations to do this in other places, I feel like this is probably the wrong place/way to do this.

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


More information about the cfe-commits mailing list