This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16785] New: [PR c++/16637 followup] syntax error on valid code


Hi,

I believe the following code is also valid.

typedef int I;

namespace A {
    typedef I I;
}

struct B {
    typedef I I;
};

struct C {
    typedef ::I I;
};

Fix to PR c++/16637 doesn't cover B::I case.

[gb@n2 gcc]$ ./g++ -B$PWD  -c /home/gb/vrac/lookup.cpp
/home/gb/vrac/lookup.cpp:8: error: declaration of `typedef I B::I'
/home/gb/vrac/lookup.cpp:1: error: changes meaning of `I' from `typedef int I'

Previous versions of gcc (3.3.X) accepts it, even icc 8.X recent enough with
-strict_ansi.

-- 
           Summary: [PR c++/16637 followup] syntax error on valid code
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gbeauchesne at mandrakesoft dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]