This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64877] strange warning message from -Waddress


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]