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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |5.3.0, 6.3.0, 7.0
         Resolution|---                         |FIXED

--- Comment #13 from Martin Sebor <msebor at gcc dot gnu.org> ---
I believe this now works correctly.  In C++ 11 mode and beyond the test case
from comment #6 is accepted and in C++ 98 mode it's rejected with the error
below.  Resolving as fixed.

$ cat t.C && gcc -S -Wall -Wextra -Wpedantic -std=c++98 t.C
    template <char *> class T {};
    T<static_cast<char *>(0)> t;
t.C:2:28: error: a cast to a type other than an integral or enumeration type
cannot appear in a constant-expression
     T<static_cast<char *>(0)> t;
                            ^
t.C:2:29: error: template argument 1 is invalid
     T<static_cast<char *>(0)> t;
                             ^

Reply via email to