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

            Bug ID: 86493
           Summary: [concepts] Hard error for "call to non-'constexpr'
                    function" in a requires expression
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Casey at Carter dot net
  Target Milestone: ---

Compiling this well-formed program:

  template <class T>
  concept bool Concept = T::f() == 0;

  struct bad {
      static int f() { return 0; }
  };

  int main() {
      static_assert(!Concept<bad>);
  }

with -fconcepts and GCC 6.3/7.3/8.1/trunk diagnoses:

  <source>: In function 'int main()':
  <source>:2:30: error: call to non-'constexpr' function 'static int bad::f()'
     concept bool Concept = T::f() == 0;
                            ~~~~^~

instead of correctly failing the concept check.

Reply via email to