public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60430] New: static_assert and reference to const/constexpr
@ 2014-03-05 16:08 florent.hivert at lri dot fr
  2014-05-28 10:04 ` [Bug c++/60430] " florent.hivert at lri dot fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: florent.hivert at lri dot fr @ 2014-03-05 16:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60430
           Summary: static_assert and reference to const/constexpr
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: florent.hivert at lri dot fr

I think the following should be accepted:


constexpr const int A = 42;
const int &B = A;
static_assert(&A == &B, "Bug");

int main() {return 0;}


Indeed, even if B is not constexpr its address is. On the contrary GCC
complains with


bug2.cpp:3:1: error: non-constant condition for static assertion
 static_assert(&A == &B, "Bug");
 ^
bug2.cpp:3:1: error: the value of ‘B’ is not usable in a constant expression
bug2.cpp:2:12: note: ‘B’ was not declared ‘constexpr’
 const int &B = A;
>From gcc-bugs-return-445500-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Mar 05 16:12:40 2014
Return-Path: <gcc-bugs-return-445500-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19231 invoked by alias); 5 Mar 2014 16:12:40 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19176 invoked by uid 48); 5 Mar 2014 16:12:37 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/60381] [4.9 Regression] ICE: in vt_expand_var_loc_chain, at var-tracking.c:8245
Date: Wed, 05 Mar 2014 16:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: debug
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: aoliva at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60381-4-JIz5smZuNT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60381-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60381-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-03/txt/msg00369.txt.bz2
Content-length: 297

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`381

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I admit I haven't timed the insn-recog.c compilation time with my patch, but I
haven't noticed that the compile time would increase significantly.  I guess I
can benchmark it now.


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

* [Bug c++/60430] static_assert and reference to const/constexpr
  2014-03-05 16:08 [Bug c++/60430] New: static_assert and reference to const/constexpr florent.hivert at lri dot fr
@ 2014-05-28 10:04 ` florent.hivert at lri dot fr
  2014-05-28 13:47 ` redi at gcc dot gnu.org
  2014-08-29 12:16 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: florent.hivert at lri dot fr @ 2014-05-28 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

Florent Hivert <florent.hivert at lri dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.8.1                       |4.9.0

--- Comment #1 from Florent Hivert <florent.hivert at lri dot fr> ---
The problem remains with the newly released GCC 4.9.0. I've upgraded the tag.


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

* [Bug c++/60430] static_assert and reference to const/constexpr
  2014-03-05 16:08 [Bug c++/60430] New: static_assert and reference to const/constexpr florent.hivert at lri dot fr
  2014-05-28 10:04 ` [Bug c++/60430] " florent.hivert at lri dot fr
@ 2014-05-28 13:47 ` redi at gcc dot gnu.org
  2014-08-29 12:16 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-05-28 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.9.0                       |4.8.1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
THere's no need to update the version - if the bug is still open t hat means
it's still a bug in later versions, and by changing it you've lost the
information that the bug is present in 4.8


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

* [Bug c++/60430] static_assert and reference to const/constexpr
  2014-03-05 16:08 [Bug c++/60430] New: static_assert and reference to const/constexpr florent.hivert at lri dot fr
  2014-05-28 10:04 ` [Bug c++/60430] " florent.hivert at lri dot fr
  2014-05-28 13:47 ` redi at gcc dot gnu.org
@ 2014-08-29 12:16 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-08-29 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-08-29
     Ever confirmed|0                           |1


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

end of thread, other threads:[~2014-08-29 12:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-05 16:08 [Bug c++/60430] New: static_assert and reference to const/constexpr florent.hivert at lri dot fr
2014-05-28 10:04 ` [Bug c++/60430] " florent.hivert at lri dot fr
2014-05-28 13:47 ` redi at gcc dot gnu.org
2014-08-29 12:16 ` 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).