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

            Bug ID: 61653
           Summary: Warning 'literal-suffix' is not suppressed by gcc
                    pragma
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ruslan_baratov at yahoo dot com

Suppression of warning '-Wliteral-suffix' is not working. Example:

> cat foo.cpp
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wliteral-suffix"

#define N
const char* x = "abc"N;

#pragma GCC diagnostic pop

> g++ -Wall -std=c++11 -c foo.cpp
foo.cpp:5:17: warning: invalid suffix on literal; C++11 requires a space
between literal and string macro [-Wliteral-suffix]
 const char* x = "abc"N;

Clang works fine for the same code:
> cat foo.cpp
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreserved-user-defined-literal"

#define N
const char* x = "abc"N;

#pragma GCC diagnostic pop

> clang++ -Wall -std=c++11 -c foo.cpp
# silence here

Version:
> g++ --version
g++ (Ubuntu 4.9-20140406-1ubuntu1) 4.9.0 20140405 (experimental) [trunk
revision 209157]
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Originally from SO:
http://stackoverflow.com/questions/24474538

Reply via email to