llvm-project/clang/lib
Dávid Bolvanský b06305e449 [Diagnostics] Warn for std::is_constant_evaluated in constexpr mode
Summary:
constexpr int fn1() {
  if constexpr (std::is_constant_evaluated()) // condition is always true!
    return 0;
  else
    return 1;
}

constexpr int fn2() {
  if (std::is_constant_evaluated())
    return 0;
  else
    return 1;
}

Solves PR42977

Reviewers: rsmith, aaron.ballman

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69518
2019-10-31 10:03:11 +01:00
..
ARCMigrate Removed some questionable default arguments from setters 2019-09-12 12:16:43 +00:00
AST [Diagnostics] Warn for std::is_constant_evaluated in constexpr mode 2019-10-31 10:03:11 +01:00
ASTMatchers [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
Analysis Thread safety analysis: Peel away NoOp implicit casts in initializers 2019-10-30 00:37:32 +01:00
Basic [OPENMP50]Add support for parallel master taskloop simd directive. 2019-10-30 10:23:33 -04:00
CodeGen Run clang-format on lib/CodeGen/CGCall.h and fix indentation 2019-10-30 18:06:12 -07:00
CrossTU [CrossTU] Fix problem with CrossTU AST load limit and progress messages. 2019-08-12 07:15:29 +00:00
DirectoryWatcher [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
Driver Revert "[CodeView] Add option to disable inline line tables." 2019-10-30 17:31:12 -07:00
Edit [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast 2019-07-02 18:28:13 +00:00
Format [Format] Add format check for throwing negative numbers 2019-10-18 16:59:02 +00:00
Frontend Revert "[CodeView] Add option to disable inline line tables." 2019-10-30 17:31:12 -07:00
FrontendTool [analyzer] Don't run the analyzer for -analyzer-list-enabled-checkers 2019-09-12 18:53:48 +00:00
Headers [Headers] Fix compatibility between arm_acle.h and intrin.h 2019-10-29 14:52:56 -07:00
Index [clang][Index] Replace CodegenNameGenerator with ASTNameGenerator 2019-09-05 20:33:52 +00:00
Lex Lexer::ReadToEndOfLine - fix Token uninitialised value warnings. NFCI. 2019-10-28 18:28:18 +00:00
Parse [OPENMP50]Add support for parallel master taskloop simd directive. 2019-10-30 10:23:33 -04:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema [MS] Don't reference deleted copy ctors from catchable types 2019-10-30 15:06:26 -07:00
Serialization [OPENMP50]Add support for parallel master taskloop simd directive. 2019-10-30 10:23:33 -04:00
StaticAnalyzer [OPENMP50]Add support for parallel master taskloop simd directive. 2019-10-30 10:23:33 -04:00
Tooling [clang][ScanDeps] Fix shadowing warning. 2019-10-30 15:53:38 -07:00
CMakeLists.txt Reland [clang] DirectoryWatcher 2019-07-12 20:34:10 +00:00