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

           Summary: [4.6 regression] [C++0x] Java-related error message
                    when trying to instantiate a strongly typed enum with
                    new
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: a.chava...@gmail.com


$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-src/configure --enable-lto --prefix=/usr
--enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 4.6.0 20110211 (experimental) (GCC) 

It was built from svn trunk, revision 170055

The following code fails to compile with this error (with -std=c++0x):
bug.cpp: In function ‘int main(int, char**)’:
bug.cpp:9:7: error: call to Java constructor, while ‘jclass’ undefined

========
int main( int argc, char** argv )
{
  enum class SomeEnum
  {
    AAA,
    BBB
  };

  new SomeEnum;

  return 0;
}
========

It worked in gcc 4.5.

Reply via email to