Bug ID: 84517
           Summary: [8 Regression] "string literal"__FILE__ no longer
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot
          Reporter: redi at gcc dot
  Target Milestone: ---

const char* err() { return "Error in "__FILE__; }

With GCC 7 this gave a warning: warning: invalid suffix on literal; C++11 requires a space
between literal and string macro [-Wliteral-suffix]
 const char* err() { return "Error in "__FILE__; }

But GCC 8 now rejects it: In function ‘const char* err()’: error: unable to find string literal operator
‘operator""__FILE__’ with ‘const char [10]’, ‘long unsigned int’ arguments
 const char* err() { return "Error in "__FILE__; }

This was caused by r254443 for PR 80955

I'm not going to add the "rejects-valid" keyword, because technically the code
is invalid, but we accept it as an extension because there is no matching UDL.

Reply via email to