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

            Bug ID: 90830
           Summary: A not fully fixed ICE?
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
  Target Milestone: ---

The bug report fixed a ICE:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70449

template <int I> 
constexpr int f ()
{
  enum E { a = f<0> () };
  return 0; 
}

Given the code, gcc 10.0.0 rejects the code:

<source>: In instantiation of 'constexpr int f() [with int I = 0]':

<source>:4:21:   required from here

<source>:4:21: error: 'constexpr int f() [with int I = 0]' called in a constant
expression before its definition is complete

    4 |   enum E { a = f<0> () };

      |                ~~~~~^~

<source>:4:8: error: enumerator value for 'a' is not an integer constant

    4 |   enum E { a = f<0> () };

      |        ^

Compiler returned: 1

However, I tried clang and icc, and both compilers accept the code. Is the bug
fully fixed?

Reply via email to