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

            Bug ID: 122228
           Summary: __PRETTY_FUNCTION__ in C++ not in ordinary literal
                    encoding
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

$ ~/src/gcc/obj52/gcc/cc1plus -quiet -std=c++11 g++.dg/cpp1y/func_constexpr.C
-fexec-charset=UTF-8
$ ~/src/gcc/obj52/gcc/cc1plus -quiet -std=c++11 g++.dg/cpp1y/func_constexpr.C
-fexec-charset=IBM1047
g++.dg/cpp1y/func_constexpr.C:6:34: error: static assertion failed: 0 ==
__builtin_strcmp (f2, "constexpr const char* pretty_function()")
    6 | #define Compare(a, b)  Assert (0 == __builtin_strcmp (a, b))
      |                                  ^
g++.dg/cpp1y/func_constexpr.C:5:40: note: in definition of macro ‘Assert’
    5 | #define Assert(expr)   static_assert ((expr), #expr)
      |                                        ^~~~
g++.dg/cpp1y/func_constexpr.C:29:1: note: in expansion of macro ‘Compare’
   29 | Compare (f2, "constexpr const char* pretty_function()");
      | ^~~~~~~
  • the comparison reduces to ‘(0 == -1)’
  • in definition of macro ‘Assert’
        5 | #define Assert(expr)   static_assert ((expr), #expr)
          |                                        ^~~~
  • in expansion of macro ‘Compare’
       29 | Compare (f2, "constexpr const char* pretty_function()");
          | ^~~~~~~

Reply via email to