public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mizvekov at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56991] constexpr std::initializer_list rejects too complex initialization
Date: Thu, 18 Apr 2013 08:10:00 -0000	[thread overview]
Message-ID: <bug-56991-4-dK2GQJEKlO@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56991-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #2 from Matheus Izvekov <mizvekov at gmail dot com> 2013-04-18 08:10:19 UTC ---
I get also a similar bug:

#include <initializer_list>

//is accepted by gcc
constexpr std::initializer_list<int> good1 = { 1, 2, 3 };

struct foo { int a, b; };

//still ok
constexpr foo good2 = { 1, 2 };

//gcc rejects this
constexpr std::initializer_list<foo> bad = { { 1, 2 }, { 3, 4} };

Compiling this gives a similar error:

test.cc:12:64: error: ‘const std::initializer_list<foo>{((const foo*)(&
_ZGRL3bad0)), 2u}’ is not a constant expression
>From gcc-bugs-return-420518-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Apr 18 08:12:47 2013
Return-Path: <gcc-bugs-return-420518-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11817 invoked by alias); 18 Apr 2013 08:12:47 -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 11788 invoked by uid 48); 18 Apr 2013 08:12:44 -0000
From: "morwenn29 at hotmail dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/56991] constexpr std::initializer_list rejects too complex initialization
Date: Thu, 18 Apr 2013 08:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: morwenn29 at hotmail dot fr
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-56991-4-mPC2I6W6w1@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56991-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56991-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg01663.txt.bz2
Content-length: 285


http://gcc.gnu.org/bugzilla/show_bug.cgi?idV991

--- Comment #3 from Morwenn <morwenn29 at hotmail dot fr> 2013-04-18 08:12:44 UTC ---
(In reply to comment #1)
> I don't see the compiler *crashing*, I see it *rejecting* the snippet.

Indeed, sorry for the poor formulation.


  parent reply	other threads:[~2013-04-18  8:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17 20:10 [Bug c++/56991] New: constexpr std::initializer_list crashes on " morwenn29 at hotmail dot fr
2013-04-18  7:50 ` [Bug c++/56991] constexpr std::initializer_list rejects " paolo.carlini at oracle dot com
2013-04-18  8:10 ` mizvekov at gmail dot com [this message]
2013-05-24 10:56 ` paolo.carlini at oracle dot com
2014-08-29 13:10 ` paolo.carlini at oracle dot com
2014-08-29 13:12 ` paolo at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56991-4-dK2GQJEKlO@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).