Building the following program below crashes g++ 4.8.0 here. --- ice.cc --- class Secret; char IsNullLiteralHelper(Secret* p); char (&IsNullLiteralHelper(...))[2]; struct C { int val() { return 42; } }; template <typename T> unsigned f() { return sizeof(IsNullLiteralHelper(C().val())); } --- ice.ii --- # 1 "ice.cc" # 1 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "<command-line>" 2 # 1 "ice.cc" class Secret; char IsNullLiteralHelper(Secret* p); char (&IsNullLiteralHelper(...))[2]; struct C { int val() { return 42; } }; template <typename T> unsigned f() { return sizeof(IsNullLiteralHelper(C().val())); } --- Compiler output --- Using built-in specs. COLLECT_GCC=/usr/bin/g++ Target: x86_64-unknown-linux-gnu Configured with: /build/src/gcc-4.8-20130411/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl --disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu --disable-install-libiberty --disable-multilib --disable-libssp --disable-werror --enable-checking=release Thread model: posix gcc version 4.8.0 20130411 (prerelease) (GCC) COLLECT_GCC_OPTIONS='-v' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus -quiet -v -D_GNU_SOURCE ice.cc -quiet -dumpbase ice.cc -mtune=generic -march=x86-64 -auxbase ice -version -o /tmp/cchdGFwc.s GNU C++ (GCC) version 4.8.0 20130411 (prerelease) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.8.0 20130411 (prerelease), GMP version 5.1.1, MPFR version 3.1.2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include /usr/local/include /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed /usr/include End of search list. GNU C++ (GCC) version 4.8.0 20130411 (prerelease) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.8.0 20130411 (prerelease), GMP version 5.1.1, MPFR version 3.1.2, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 6f2c8a0d923b5a4be7dedefadd250ed4 ice.cc: In function ‘unsigned int f()’: ice.cc:13:48: internal compiler error: in value_dependent_expression_p, at cp/pt.c:19598 return sizeof(IsNullLiteralHelper(C().val())); ^ Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.archlinux.org/> for instructions.
Confirmed.
Fixed for 4.8.1.
For reference, this was fixed in r198882: http://gcc.gnu.org/git/?p=gcc.git;a=commit;h=28038d26df63ee5755da90bb563db4097a9deec0