diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/readability-else-after-return-if-constexpr.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/readability-else-after-return-if-constexpr.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/clang-tools-extra/test/clang-tidy/readability-else-after-return-if-constexpr.cpp b/clang-tools-extra/test/clang-tidy/readability-else-after-return-if-constexpr.cpp deleted file mode 100644 index 6532940eaf2..00000000000 --- a/clang-tools-extra/test/clang-tidy/readability-else-after-return-if-constexpr.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// RUN: %check_clang_tidy %s readability-else-after-return %t -- -- -std=c++17
-
-// Constexpr if is an exception to the rule, we cannot remove the else.
-void f() {
- if (sizeof(int) > 4)
- return;
- else
- return;
- // CHECK-MESSAGES: [[@LINE-2]]:3: warning: do not use 'else' after 'return'
-
- if constexpr (sizeof(int) > 4)
- return;
- else
- return;
-
- if constexpr (sizeof(int) > 4)
- return;
- else if constexpr (sizeof(long) > 4)
- return;
- else
- return;
-}
|