The following code incorrectly warns that the function g is missing a return statement. The warning goes away if __FUNCTION__ is replaced by (const char*)__FUNCTION__. ================ BEGIN CODE ================== void f(const char*) __attribute__ ((noreturn)); template<class T> class A { int g() { f(__FUNCTION__); //f((const char*)__FUNCTION__); } }; template class A<int>; ============================ END code wedge:scratch% g++ -O3 -Wall -c -v noreturn.cpp Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux Thread model: posix gcc version 4.1.1 20060525 (Red Hat 4.1.1-1) /usr/libexec/gcc/x86_64-redhat-linux/4.1.1/cc1plus -quiet -v -D_GNU_SOURCE noreturn.cpp -quiet -dumpbase noreturn.cpp -mtune=generic -auxbase noreturn -O3 -Wall -version -o /tmp/ccVj3EZ3.s ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../x86_64-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1 /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/x86_64-redhat-linux /usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../include/c++/4.1.1/backward /usr/local/include /usr/lib/gcc/x86_64-redhat-linux/4.1.1/include /usr/include End of search list. GNU C++ version 4.1.1 20060525 (Red Hat 4.1.1-1) (x86_64-redhat-linux) compiled by GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 56236c31509b2b0d4a3c4ac0327da7d9 noreturn.cpp: In member function ‘int A<T>::g()’: noreturn.cpp:10: warning: no return statement in function returning non-void as -V -Qy -o noreturn.o /tmp/ccVj3EZ3.s GNU assembler version 2.16.91.0.6 (x86_64-redhat-linux) using BFD version 2.16.91.0.6 20060212
*** This bug has been marked as a duplicate of 30988 ***