[Bug preprocessor/57760] New: preprocessor directive supress g++ warning

dimhen at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Jun 30 08:30:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57760

            Bug ID: 57760
           Summary: preprocessor directive supress g++ warning
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com

gcc version 4.9.0 20130629 (experimental) [trunk revision 200565] (GCC)
gcc version 4.8.1 20130603 (Red Hat 4.8.1-1) (GCC)

if I uncomment first line in x.ii : // #2064 "" 3
then there will be no warning from gcc

$ g++ -fsyntax-only -Wall -Wextra -Werror x.ii
x.ii: In member function 'void x8::x10() const':
x.ii:25:26: error: statement has no effect [-Werror=unused-value]
         &x6 < x0, 0 >::x7;
                          ^
cc1plus: all warnings being treated as errors


$ cat x.ii
//#2064 "" 3
struct x0;
class x1
{
public:
    enum x2
    { x3 };
};
class x4
{
};
template < class x5, int x2 > class x6:public x4
{
public:
    static const x6 x7;
};
class x8
{
protected:
    unsigned int x9;
    void x10 (void) const
    {
        switch (static_cast < x1::x2 > (x9))
        case x1::x3:
        &x6 < x0, 0 >::x7;
    }
};
template <> const x6 < x0, int (x1::x3) > x6 < x0, int (x1::x3) >::x7 = x6 ();



More information about the Gcc-bugs mailing list