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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
      Known to fail|                            |4.9.3, 5.3.0, 6.0

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with all supported versions of GCC including the current trunk of
6.0.

A slightly simplified test case:

$ cat v.c && /home/msebor/build/gcc-trunk-git/gcc/xgcc
-B/home/msebor/build/gcc-trunk-git/gcc -S -Wall -Wextra -Wpedantic -o/dev/null
-xc++ v.c
struct S {
    static constexpr char a[] = "A";
    static constexpr char b[] = "A";

    template <const char *S>
    static bool f () {
        constexpr bool isa = S == a;
        constexpr bool isb = S == b;
        return isa || isb;
    }
};

template bool S::f<S::a>();
template bool S::f<S::b>();

v.c: In instantiation of ‘static bool S::f() [with const char* S = ((const
char*)(& S::a))]’:
v.c:13:26:   required from here
v.c:8:32: error: ‘(((const char*)(& S::a)) == ((const char*)(& S::b)))’ is not
a constant expression
         constexpr bool isb = S == b;
                              ~~^~~~
v.c: In instantiation of ‘static bool S::f() [with const char* S = ((const
char*)(& S::b))]’:
v.c:14:26:   required from here
v.c:7:32: error: ‘(((const char*)(& S::b)) == ((const char*)(& S::a)))’ is not
a constant expression
         constexpr bool isa = S == a;
                              ~~^~~~

Reply via email to