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++/49224] [C++0x] Scoped enumeration instantiated even if not required


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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-18
     Ever confirmed|0                           |1

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
Actually scratch that, my version of clang is old so it doesn't default to
c++11. When I manually force -std=c++0x, clang accepts the code, while g++
still rejects it:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic -std=c++0x 49224.cc
49224.cc: In instantiation of ‘struct A<int>’:
49224.cc:9:9:   required from here
49224.cc:3:13: error: ‘value’ is not a member of ‘int’
  enum class B {
             ^
49224.cc: In function ‘int main()’:
49224.cc:9:9: warning: unused variable ‘a’ [-Wunused-variable]
  A<int> a;
         ^
$ /sw/opt/llvm-3.1/bin/clang++ -c -Wall -Wextra -pedantic -std=c++0x 49224.cc
49224.cc:9:9: warning: unused variable 'a' [-Wunused-variable]
        A<int> a;
               ^
1 warning generated.
$

So confirming then.

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