Skip to content
Commit b06305e4 authored by Dávid Bolvanský's avatar Dávid Bolvanský
Browse files

[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
parent c9504954
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment