Commit 0d989b2
authored
[clang] Avoid warnings about enum mismatch in ternary expressions. NFC. (#159338)
This avoids the following kind of warning when built with GCC:
../../clang/lib/Sema/SemaStmtAttr.cpp: In function ‘clang::Attr* ProcessStmtAttribute(clang::Sema&, clang::Stmt*, const clang::ParsedAttr&, clang::SourceRange)’:
../../clang/lib/Sema/SemaStmtAttr.cpp:677:30: warning: enumerated mismatch in conditional expression: ‘clang::diag::<unnamed enum>’ vs ‘clang::diag::<unnamed enum>’ [-Wenum-compare]
676 | S.Diag(A.getLoc(), A.isRegularKeywordAttribute()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
677 | ? diag::err_keyword_not_supported_on_targe
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
678 | : diag::warn_unhandled_ms_attribute_ignore )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These enums are non-overlapping, but due they are defined in different
enum scopes due to how they are generated with tablegen.1 parent aa5558d commit 0d989b2
2 files changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6839 | 6839 | | |
6840 | 6840 | | |
6841 | 6841 | | |
6842 | | - | |
6843 | | - | |
6844 | | - | |
6845 | | - | |
| 6842 | + | |
| 6843 | + | |
| 6844 | + | |
| 6845 | + | |
| 6846 | + | |
6846 | 6847 | | |
6847 | 6848 | | |
6848 | 6849 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
679 | 680 | | |
680 | 681 | | |
681 | 682 | | |
| |||
0 commit comments