[Bug c++/53371] New: rvalue reference type as exception-declaration

vexocide at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed May 16 03:30:00 GMT 2012


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

             Bug #: 53371
           Summary: rvalue reference type as exception-declaration
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vexocide@gmail.com


Using built-in specs.
COLLECT_GCC=g++-mp-4.7
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin10/4.7.0/lto-wrapper
Target: x86_64-apple-darwin10
Configured with: ../gcc-4.7.0/configure --prefix=/opt/local
--build=x86_64-apple-darwin10
--enable-languages=c,c++,objc,obj-c++,lto,fortran,java
--libdir=/opt/local/lib/gcc47 --includedir=/opt/local/include/gcc47
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local
--with-local-prefix=/opt/local --with-system-zlib --disable-nls
--program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/c++/
--with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local
--with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl
--enable-stage1-checking --disable-multilib --enable-lto
--with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld
--with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket
--with-pkgversion='MacPorts gcc47 4.7.0_3'
Thread model: posix
gcc version 4.7.0 (MacPorts gcc47 4.7.0_3)


g++-mp-4.7 foo.cpp -o foo -std=c++11


The C++11 standard states "The exception-declaration shall not denote an
incomplete type, an abstract class type, or an rvalue reference type." in
section 15.3, however the attached code compiles.


clang++-mp-3.0 foo.cpp -o foo -std=c++11 gives

foo.cpp:8:19: error: cannot catch exceptions by rvalue reference
    } catch (A && a) {
                  ^



More information about the Gcc-bugs mailing list