================
@@ -626,6 +626,8 @@ void UnwrappedLineParser::calculateBraceTypes(bool 
ExpectClassBody) {
     case tok::kw_switch:
     case tok::kw_try:
     case tok::kw___try:
+      if (PrevTok->is(tok::hash))
+        break;
----------------
owenca wrote:

This should be applied to `kw_if` only, right? So something like the following 
instead?
```
    case tok::identifier:
      if (Tok->isNot(TT_StatementMacro))
        break;
      [[fallthrough]];
    case tok::kw_if:
      if (PrevTok->is(tok::hash))
        break;
      [[fallthrough]];
    case tok::at:
    case tok::semi:
    case tok::kw_while:
    case tok::kw_for:
    case tok::kw_switch:
    case tok::kw_try:
    case tok::kw___try:
      if (!LBraceStack.empty() && LBraceStack.back().Tok->is(BK_Unknown))
        LBraceStack.back().Tok->setBlockKind(BK_Block);
      break;
```

https://github.com/llvm/llvm-project/pull/65409
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to