This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70196] inconsistent constness of inequality of weak symbol addresses
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Mar 2016 18:29:44 +0000
- Subject: [Bug c++/70196] inconsistent constness of inequality of weak symbol addresses
- Auto-submitted: auto-generated
- References: <bug-70196-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70196
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Known to fail| |4.9.3, 5.3.0, 6.0
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
All supported versions behave this way. This is also not specific to constexpr
but a more general issue. Below is a test case that doesn't involve constexpr.
$ cat v.c && /home/msebor/build/gcc-trunk-svn/gcc/xgcc
-B/home/msebor/build/gcc-trunk-svn/gcc -S -Wall -Wextra -Wpedantic -o/dev/null
-std=c++11 -xc++ v.c
extern __attribute__ ((weak)) int i;
template <bool> struct S { };
S<!(&i < 0)> s0; // accepted
S<&i == 0> s1; // rejected
v.c:5:10: warning: ordered comparison of pointer with integer zero [-Wextra]
S<!(&i < 0)> s0; // accepted
^
v.c:6:10: error: template argument 1 is invalid
S<&i == 0> s1; // rejected
^