https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97051

            Bug ID: 97051
           Summary: Evaluating is_constant_evaluated in requires clause
                    fails
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: david at doublewise dot net
  Target Milestone: ---

The following program



#include <type_traits>

template<typename>
        requires((std::is_constant_evaluated(), true))
constexpr int a = 0;

constexpr int b = a<int>;



when compiled with `g++ -std=c++20` fails with



<source>:9:19: error: use of invalid variable template 'a<int>'

    9 | constexpr int b = a<int>;

      |                   ^~~~~~

<source>:9:19: note: constraints not satisfied

Compiler returned: 1




See it live: https://godbolt.org/z/fc5cWE

Reply via email to