[Bug bootstrap/61006] New: libcpp/lex.c: must use 'enum' tag to refer to type "raw_str_phase"

2014-04-29 Thread spamcop at tgos dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61006

Bug ID: 61006
   Summary: libcpp/lex.c: must use 'enum' tag to refer to type
"raw_str_phase"
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: blocker
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
      Reporter: spamcop at tgos dot net

gcc-4.9.0/libcpp/lex.c:1394

The original line is:

raw_str_phase phase = RAW_STR_PREFIX;

This is incorrect. It must be:

enum raw_str_phase phase = RAW_STR_PREFIX;

Because raw_str_phase is an enum type, it isn't typedef'ed and lex.c is a C
file (not a C++ file). As a result, when building with clang, it correctly
complains:

"must use 'enum' tag to refer to type 'raw_str_phase'"


[Bug bootstrap/61006] libcpp/lex.c: must use 'enum' tag to refer to type "raw_str_phase"

2014-04-29 Thread spamcop at tgos dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61006

--- Comment #2 from spamcop at tgos dot net ---
Okay, but looking at the rest of the code, this seems to be the only
enum/struct/union that is not correctly "typed" according to C rules. E.g. all
the other variables of enum type have `enum` in the variable declaration and if
I just fix this one line, the file compiles as standard C without any problem.
So if nothing else than this line is a at least a serve break of style compared
to the rest of the file and as far as I can tell the only reason why this file
is not standard C and would need a C++ compiler.