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++/59686] Non-constexpr pointers accepted in constant expressions


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, "");
}


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