[clang] [clang] Avoid warnings about enum mismatch in ternary expressions. NFC. (PR #159338)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 17 06:19:34 PDT 2025


================
@@ -674,8 +674,10 @@ static Attr *ProcessStmtAttribute(Sema &S, Stmt *St, const ParsedAttr &A,
          A.existsInTarget(*Aux)))) {
     if (A.isRegularKeywordAttribute() || A.isDeclspecAttribute()) {
----------------
erichkeane wrote:

I think I agree with corentin, just breaking this up into 2 branches (an `if (A.isRegularKeywordAttribute())` and `else if (A.isDeclspecAttribute())` is probably better.  As it is, we're basically checking the regular keyword 2x.

Else, this patch is fine for me.

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


More information about the cfe-commits mailing list