This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64877] strange warning message from -Waddress
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Jan 2015 18:49:50 +0000
- Subject: [Bug c++/64877] strange warning message from -Waddress
- Auto-submitted: auto-generated
- References: <bug-64877-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64877
--- Comment #3 from Tom Tromey <tromey at gcc dot gnu.org> ---
Oops, had the wrong gcc in $PATH.
That test case does warn:
pokyo. g++ -std=c++11 -c -Wall -Waddress -O2 x.cc
x.cc: In instantiation of âS<Derived>::S() [with Derived = T]â:
x.cc:19:8: required from here
x.cc:9:29: warning: the address of âvoid S<Derived>::Unwrap() [with Derived =
T]â will never be NULL [-Waddress]
if (&S<Derived>::Unwrap != &Derived::Unwrap)
^
I think I would expect a warning on the second assert, but not the first.