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++/64758] New: [C++11] Give better error message when name of enum's base type cannot be resolved


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

            Bug ID: 64758
           Summary: [C++11] Give better error message when name of enum's
                    base type cannot be resolved
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeratul976 at hotmail dot com

For the following invalid code:


  enum Waldo : uint32_t {   // oops, forgot to include <stdint.h>
    A, B
  };


GCC's error message is: 


  test.cpp:1:6: error: use of enum âWaldoâ without previous declaration
   enum Waldo : uint32_t {
        ^
  test.cpp:1:12: error: expected unqualified-id before â:â token
   enum Waldo : uint32_t {
              ^

This error doesn't really match the problem. A much better error would be:


  test.cpp:1:6: error: use of âuint32_tâ without previous declaration
   enum Waldo : uint32_t {
                ^

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