Commit 98714ed
committed
[clang] [Parse] Avoid mixing enum and non-enum types in ternary expressions. NFC.
This fixes the following kind of warning when compiled with GCC:
../../clang/lib/Parse/ParseStmt.cpp: In member function ‘clang::StmtResult clang::Parser::ParseCXXTryBlockCommon(clang::SourceLocation, bool)’:
../../clang/lib/Parse/ParseStmt.cpp:2534:40: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
2534 | (FnTry ? Scope::FnTryCatchScope : 0)));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use `Scope::NoScope` instead of literal 0 as fallback in the
ternary expressions.1 parent 0a7a7d5 commit 98714ed
3 files changed
+16
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6813 | 6813 | | |
6814 | 6814 | | |
6815 | 6815 | | |
6816 | | - | |
6817 | | - | |
6818 | | - | |
6819 | | - | |
| 6816 | + | |
| 6817 | + | |
| 6818 | + | |
| 6819 | + | |
6820 | 6820 | | |
6821 | 6821 | | |
6822 | 6822 | | |
| |||
7097 | 7097 | | |
7098 | 7098 | | |
7099 | 7099 | | |
7100 | | - | |
7101 | | - | |
| 7100 | + | |
| 7101 | + | |
| 7102 | + | |
7102 | 7103 | | |
7103 | 7104 | | |
7104 | 7105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3295 | 3295 | | |
3296 | 3296 | | |
3297 | 3297 | | |
3298 | | - | |
3299 | | - | |
3300 | | - | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
3301 | 3301 | | |
3302 | 3302 | | |
3303 | 3303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2529 | 2529 | | |
2530 | 2530 | | |
2531 | 2531 | | |
2532 | | - | |
2533 | | - | |
2534 | | - | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
2535 | 2535 | | |
2536 | 2536 | | |
2537 | 2537 | | |
| |||
2593 | 2593 | | |
2594 | 2594 | | |
2595 | 2595 | | |
2596 | | - | |
2597 | | - | |
2598 | | - | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
2599 | 2599 | | |
2600 | 2600 | | |
2601 | 2601 | | |
| |||
0 commit comments