[Bug c++/59423] New: Misleading warning when 'enum class' base type unresolved: elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword
gnubugzilla at drewnoakes dot com
gcc-bugzilla@gcc.gnu.org
Sun Dec 8 23:14:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59423
Bug ID: 59423
Summary: Misleading warning when 'enum class' base type
unresolved: elaborated-type-specifier for a scoped
enum must not use the ‘class’ keyword
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gnubugzilla at drewnoakes dot com
If the base type of an enum class cannot be resolved, g++ gives a confusing
error message:
> warning: elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword
An example is given and discussed here:
http://stackoverflow.com/q/20459120/24874
enum class FaceDirection : int8
{
Down,
Up
};
In this example, I did not have a typedef for int8 in scope. A better error
message would state something similar to: "Unknown type name 'int8'."
g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 on Ubuntu 13.10, installed from
Ubuntu's repositories. Compiling using -std=c++11.
More information about the Gcc-bugs
mailing list