[Bug c++/91155] New: __PRETTY_FUNCTION__ gets truncated when char template parameter is '\0'

d.frey at gmx dot de gcc-bugzilla@gcc.gnu.org
Fri Jul 12 21:13:00 GMT 2019


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

            Bug ID: 91155
           Summary: __PRETTY_FUNCTION__ gets truncated when char template
                    parameter is '\0'
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.frey at gmx dot de
  Target Milestone: ---

This is a regression against 8.x:

#include <iostream>

template< char C > struct dummy {};
template< typename T > void test()
{
    std::cout << __PRETTY_FUNCTION__ << std::endl;
}

int main()
{
    test< dummy< '\0' > >();
}

Incorrect output with GCC 9.1:

void test() [with T = dummy<'

Correct output with GCC 8.3:

void test() [with T = dummy<'\000'>]

Link: https://godbolt.org/z/SC3nJ7


More information about the Gcc-bugs mailing list