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++/51543] New: terrible diagnostic for wrong type when expected class or namespace


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

             Bug #: 51543
           Summary: terrible diagnostic for wrong type when expected class
                    or namespace
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: manu@gcc.gnu.org


Noticed here: http://llvm.org/devmtg/2011-11/Gregor_ExtendingClang.pdf

Testcase:

typedef int N;
N::string str;

gcc 4.7:

namespace.cc:2:11: error: expected initializer before âstrâ

clang 3.0:

namespace.cc:2:1: error: expected a class or namespace
N::string str;
^

clang 3.1:

t.cpp:2:1: error: âNâ (aka âintâ) is not a class or namespace
N::string str;
^
t.cpp:1:13: note: declared here
typedef int N;
^


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