"g++ -std=c++11" rejects the following program:
int main() { bool /*const*/ condition = false;
[&]{ try{} catch(...){ if(condition){} } }(); }
If the condition variable is const, the compilation successes.
Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/home/user/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc/configure --prefix=/home/user/gcc-trunk --disable-bootstrap --disable-multilib --enable-languages=c,c++,fortran --with-gmp=/home/user/gcc-trunk/src/build/backends --with-mpfr=/home/user/gcc-trunk/src/build/backends --with-mpc=/home/user/gcc-trunk/src/build/backends Thread model: posix gcc version 4.8.0 20130219 (experimental) (GCC)
"g++ -std=c++11" rejects the following program:
int main()
{
bool /*const*/ condition = false;
[&]{
if( condition) {}
try{}
catch(...){
}
}();
}
If the condition variable is const, the compilation successes.
Using built-in specs. LTO_WRAPPER= /home/user/ gcc-trunk/ libexec/ gcc/x86_ 64-unknown- linux-gnu/ 4.8.0/lto- wrapper unknown- linux-gnu /home/user/ gcc-trunk --disable-bootstrap --disable-multilib --enable- languages= c,c++,fortran --with- gmp=/home/ user/gcc- trunk/src/ build/backends --with- mpfr=/home/ user/gcc- trunk/src/ build/backends --with- mpc=/home/ user/gcc- trunk/src/ build/backends
COLLECT_GCC=g++
COLLECT_
Target: x86_64-
Configured with: ../gcc/configure --prefix=
Thread model: posix
gcc version 4.8.0 20130219 (experimental) (GCC)