public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59686] New: Non-constexpr pointers accepted in constant expressions
@ 2014-01-05 17:17 ville.voutilainen at gmail dot com
  2014-01-05 17:19 ` [Bug c++/59686] " ville.voutilainen at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-01-05 17:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59686

            Bug ID: 59686
           Summary: Non-constexpr pointers accepted in constant
                    expressions
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com

int main
{
    static const int x = 5;
    const int * const y = &x;
    static_assert(y, "");
}

clang rejects this, gcc accepts.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59686] Non-constexpr pointers accepted in constant expressions
  2014-01-05 17:17 [Bug c++/59686] New: Non-constexpr pointers accepted in constant expressions ville.voutilainen at gmail dot com
@ 2014-01-05 17:19 ` ville.voutilainen at gmail dot com
  2014-05-07 19:59 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ville.voutilainen at gmail dot com @ 2014-01-05 17:19 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59686] Non-constexpr pointers accepted in constant expressions
  2014-01-05 17:17 [Bug c++/59686] New: Non-constexpr pointers accepted in constant expressions ville.voutilainen at gmail dot com
  2014-01-05 17:19 ` [Bug c++/59686] " ville.voutilainen at gmail dot com
@ 2014-05-07 19:59 ` redi at gcc dot gnu.org
  2015-03-19  8:51 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2014-05-07 19:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59686

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-07
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59686] Non-constexpr pointers accepted in constant expressions
  2014-01-05 17:17 [Bug c++/59686] New: Non-constexpr pointers accepted in constant expressions ville.voutilainen at gmail dot com
  2014-01-05 17:19 ` [Bug c++/59686] " ville.voutilainen at gmail dot com
  2014-05-07 19:59 ` redi at gcc dot gnu.org
@ 2015-03-19  8:51 ` paolo.carlini at oracle dot com
  2015-03-19  8:57 ` paolo at gcc dot gnu.org
  2015-03-19  8:58 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-19  8:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59686

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mainline properly rejects this. I'm adding the testcase and closing the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59686] Non-constexpr pointers accepted in constant expressions
  2014-01-05 17:17 [Bug c++/59686] New: Non-constexpr pointers accepted in constant expressions ville.voutilainen at gmail dot com
                   ` (2 preceding siblings ...)
  2015-03-19  8:51 ` paolo.carlini at oracle dot com
@ 2015-03-19  8:57 ` paolo at gcc dot gnu.org
  2015-03-19  8:58 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-03-19  8:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59686

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Thu Mar 19 08:57:01 2015
New Revision: 221510

URL: https://gcc.gnu.org/viewcvs?rev=221510&root=gcc&view=rev
Log:
2015-03-19  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/59686
    * g++.dg/cpp0x/constexpr-59686.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-59686.C
Modified:
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/59686] Non-constexpr pointers accepted in constant expressions
  2014-01-05 17:17 [Bug c++/59686] New: Non-constexpr pointers accepted in constant expressions ville.voutilainen at gmail dot com
                   ` (3 preceding siblings ...)
  2015-03-19  8:57 ` paolo at gcc dot gnu.org
@ 2015-03-19  8:58 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-19  8:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59686

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Done.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-19  8:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-05 17:17 [Bug c++/59686] New: Non-constexpr pointers accepted in constant expressions ville.voutilainen at gmail dot com
2014-01-05 17:19 ` [Bug c++/59686] " ville.voutilainen at gmail dot com
2014-05-07 19:59 ` redi at gcc dot gnu.org
2015-03-19  8:51 ` paolo.carlini at oracle dot com
2015-03-19  8:57 ` paolo at gcc dot gnu.org
2015-03-19  8:58 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).