https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68208
Bug ID: 68208 Summary: g++ doesn't warn against reference self-initialization Product: gcc Version: 5.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ooprala at redhat dot com Target Milestone: --- Created attachment 36647 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36647&action=edit reproducer /usr/bin/gcc -v Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-default-libstdcxx-abi=c++98 --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC) g++ remains silent with -Wall -Wextra. However, even with no extra options, clang++ -c repr.cc emits: repr.cc:4:10: warning: reference 'm' is not yet bound to a value when used here [-Wuninitialized] S0():m(m){} ^ 1 warning generated.