This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/59686] Non-constexpr pointers accepted in constant expressions
- From: "ville.voutilainen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 05 Jan 2014 17:19:24 +0000
- Subject: [Bug c++/59686] Non-constexpr pointers accepted in constant expressions
- Auto-submitted: auto-generated
- References: <bug-59686-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59686
--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
(In reply to Ville Voutilainen from comment #0)
> int main
> {
> static const int x = 5;
> const int * const y = &x;
> static_assert(y, "");
> }
>
> clang rejects this, gcc accepts.
well, typo, should be int main(), of course... in other words,
int main()
{
static const int x = 5;
const int * const y = &x;
static_assert(y, "");
}