public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list
@ 2011-11-21  4:24 ai.azuma at gmail dot com
  2012-10-10  9:24 ` [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses " paolo.carlini at oracle dot com
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: ai.azuma at gmail dot com @ 2011-11-21  4:24 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51253
           Summary: [C++11][DR 1030] Evaluation order (sequenced-before
                    relation) among intializer-clauses in braced-init-list
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ai.azuma@gmail.com


Since DR 1030 http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030
was accepted, I expect that the following code is well-defined and exits with
the status code 0. However, GCC 4.7.0 20111112 (experimental) with -std=c++11
produces a wrong executable. In addition, it spuriously warns about undefined
operations with -Wsequence-point option.

//////////////////////////////////
struct swallow{
  template<typename... Types>
  swallow(Types &&...){}
};

template<int... IS>
int f()
{
  int i = 2;
  swallow{ i = i * IS + IS... };
  return i;
}

int main()
{
  // `i = i * 2 + 2' should be sequenced before `i = i * 3 + 3'
  return f<2, 3>() == 21 ? 0 : 1;
}
//////////////////////////////////


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
@ 2012-10-10  9:24 ` paolo.carlini at oracle dot com
  2013-07-05 13:49 ` akim.demaille at gmail dot com
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-10  9:24 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-10
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-10 09:24:08 UTC ---
Confirming.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
  2012-10-10  9:24 ` [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses " paolo.carlini at oracle dot com
@ 2013-07-05 13:49 ` akim.demaille at gmail dot com
  2013-07-05 15:06 ` paolo.carlini at oracle dot com
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: akim.demaille at gmail dot com @ 2013-07-05 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

Akim Demaille <akim.demaille at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |akim.demaille at gmail dot com

--- Comment #2 from Akim Demaille <akim.demaille at gmail dot com> ---
Ping.  Still there with released 4.8.1 on GNU/Linux.  Using initializer lists
this way is a very handy way to handle variadic templates.

Cheers, and thanks for all the good work!


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
  2012-10-10  9:24 ` [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses " paolo.carlini at oracle dot com
  2013-07-05 13:49 ` akim.demaille at gmail dot com
@ 2013-07-05 15:06 ` paolo.carlini at oracle dot com
  2013-08-13 17:07 ` broes.decat at gmail dot com
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-05 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (2 preceding siblings ...)
  2013-07-05 15:06 ` paolo.carlini at oracle dot com
@ 2013-08-13 17:07 ` broes.decat at gmail dot com
  2013-10-23 16:38 ` st at quanttec dot com
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: broes.decat at gmail dot com @ 2013-08-13 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

Broes De Cat <broes.decat at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |broes.decat at gmail dot com

--- Comment #3 from Broes De Cat <broes.decat at gmail dot com> ---
Confirmed, hit the bug with 4.7.3 in c++11 mode.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (3 preceding siblings ...)
  2013-08-13 17:07 ` broes.decat at gmail dot com
@ 2013-10-23 16:38 ` st at quanttec dot com
  2013-11-25 11:54 ` akim.demaille at gmail dot com
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: st at quanttec dot com @ 2013-10-23 16:38 UTC (permalink / raw)
  To: gcc-bugs

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

Stephan Tolksdorf <st at quanttec dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |st at quanttec dot com

--- Comment #4 from Stephan Tolksdorf <st at quanttec dot com> ---
I just stumbled over this bug with the current trunk version of GCC. It's a
pretty ugly bug.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (4 preceding siblings ...)
  2013-10-23 16:38 ` st at quanttec dot com
@ 2013-11-25 11:54 ` akim.demaille at gmail dot com
  2014-01-18 16:12 ` akim.demaille at gmail dot com
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: akim.demaille at gmail dot com @ 2013-11-25 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Akim Demaille <akim.demaille at gmail dot com> ---
Happy two-year birthday, bug!  Sorry I'm (slightly more that) off-by-one.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (5 preceding siblings ...)
  2013-11-25 11:54 ` akim.demaille at gmail dot com
@ 2014-01-18 16:12 ` akim.demaille at gmail dot com
  2014-03-06 14:38 ` akim.demaille at gmail dot com
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: akim.demaille at gmail dot com @ 2014-01-18 16:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Akim Demaille <akim.demaille at gmail dot com> ---
FWIW, because of this issue, I no longer use g++ for my project, which saddens
me.  If there were a means to put money on some bugs, I'd be happy to drop say
$50.  I do not pretend that should suffice, but maybe other people would be
happy to put money on their bugs, and maybe in end some bugs might be worth
shooting at.  Sort of crowd-funding.  Of course it would require some
infrastructure to support this, but maybe this would be worth considering?

Best regards.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (6 preceding siblings ...)
  2014-01-18 16:12 ` akim.demaille at gmail dot com
@ 2014-03-06 14:38 ` akim.demaille at gmail dot com
  2014-03-13 17:07 ` paolo.carlini at oracle dot com
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: akim.demaille at gmail dot com @ 2014-03-06 14:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Akim Demaille <akim.demaille at gmail dot com> ---
Hi all,

I'd really love to have some feedback on this issue.  It looks like nobody is
having a look at this.

Thanks for all the good work, and sorry for insisting.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (7 preceding siblings ...)
  2014-03-06 14:38 ` akim.demaille at gmail dot com
@ 2014-03-13 17:07 ` paolo.carlini at oracle dot com
  2014-03-13 17:40 ` manu at gcc dot gnu.org
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-03-13 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Let's add Jason in CC.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (8 preceding siblings ...)
  2014-03-13 17:07 ` paolo.carlini at oracle dot com
@ 2014-03-13 17:40 ` manu at gcc dot gnu.org
  2014-04-10  8:14 ` akim.demaille at gmail dot com
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: manu at gcc dot gnu.org @ 2014-03-13 17:40 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Akim Demaille from comment #6)
> FWIW, because of this issue, I no longer use g++ for my project, which
> saddens me.  If there were a means to put money on some bugs, I'd be happy
> to drop say $50.  I do not pretend that should suffice, but maybe other
> people would be happy to put money on their bugs, and maybe in end some bugs
> might be worth shooting at.  Sort of crowd-funding.  Of course it would
> require some infrastructure to support this, but maybe this would be worth
> considering?

It would be nice if such infrastructure existed. Perhaps it would motivate more
people to contribute to GCC (current contributors have their hands pretty full
already). I know of: https://www.bountysource.com/trackers/384568-gcc
but I have never used it, so I don't know how it works.
>From gcc-bugs-return-446210-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 13 17:49:48 2014
Return-Path: <gcc-bugs-return-446210-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29598 invoked by alias); 13 Mar 2014 17:49:48 -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 29565 invoked by uid 48); 13 Mar 2014 17:49:44 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/60455] Imprecise column number of -Woverflow in array initializers
Date: Thu, 13 Mar 2014 17:49: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-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc assigned_to everconfirmed
Message-ID: <bug-60455-4-mK1KcwVSJO@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60455-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60455-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/msg01079.txt.bz2
Content-length: 643

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-03-13
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Mine.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (9 preceding siblings ...)
  2014-03-13 17:40 ` manu at gcc dot gnu.org
@ 2014-04-10  8:14 ` akim.demaille at gmail dot com
  2014-04-11 17:09 ` jason at gcc dot gnu.org
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: akim.demaille at gmail dot com @ 2014-04-10  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Akim Demaille <akim.demaille at gmail dot com> ---
Well, I have finally found a simple workaround for some of the cases: GCC seems
to be right in the order of evaluation when initializing an array so:

template<int... IS>
int f1()
{
  int i = 0;
  swallow{ i = 10 * i + IS... };
  return i;
}

fails, but

template<int... IS>
int f2()
{
  using swallow = int[];
  int i = 0;
  (void) swallow{ i = 10 * i + IS... };
  return i;
}

succeeds.  However, GCC's own libstdc++ is exposed to this bug, for instance
make_tuple.

$ cat foo.cc
#include <iostream>
#include <tuple>

struct swallow
{
  template<typename... Types>
  swallow(Types &&...){}
};

int incr()
{
  static int res = 2;
  return res++;
}

template<int... IS>
int f1()
{
  int i = 0;
  swallow{ i = 10 * i + IS... };
  return i;
}

template<int... IS>
int f2()
{
  using swallow = int[];
  int i = 0;
  (void) swallow{ i = 10 * i + IS... };
  return i;
}

int main()
{
  // `i = i * 2 + 2' should be sequenced before `i = i * 3 + 3'
  std::cerr << f1<2, 3>() << '\t';
  std::cerr << f2<2, 3>() << '\t';
  auto t = std::make_tuple(incr(), incr());
  std::cerr << std::get<0>(t) << std::get<1>(t) << '\n';
}

$ ./a.32
23    23    23
$ ./a.33
23    23    23
$ ./a.34
23    23    23
$ ./a.35
23    23    23
$ ./a.48
32    23    32
$ ./a.49
32    23    32

where 32...35 is clang++, and 48,49 is gcc.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (10 preceding siblings ...)
  2014-04-10  8:14 ` akim.demaille at gmail dot com
@ 2014-04-11 17:09 ` jason at gcc dot gnu.org
  2014-06-03  9:29 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2014-04-11 17:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Apr 11 17:08:47 2014
New Revision: 209309

URL: http://gcc.gnu.org/viewcvs?rev=209309&root=gcc&view=rev
Log:
    DR 1030
    PR c++/51253
    * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
    * call.c (struct z_candidate): Add flags field.
    (add_candidate): Add flags parm.
    (add_function_candidate, add_conv_candidate, build_builtin_candidate)
    (add_template_candidate_real): Pass it.
    (build_over_call): Set CALL_EXPR_LIST_INIT_P.
    * tree.c (build_aggr_init_expr): Copy it.
    * semantics.c (simplify_aggr_init_expr): Preevaluate args if it's set.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/tree.c


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (11 preceding siblings ...)
  2014-04-11 17:09 ` jason at gcc dot gnu.org
@ 2014-06-03  9:29 ` redi at gcc dot gnu.org
  2014-06-04  1:11 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: redi at gcc dot gnu.org @ 2014-06-03  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Akim Demaille from comment #10)
>   auto t = std::make_tuple(incr(), incr());

That's not an initializer-list, it's a function call, so the order of
evaluation is not specified and that example is not relevant AFAICT.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (12 preceding siblings ...)
  2014-06-03  9:29 ` redi at gcc dot gnu.org
@ 2014-06-04  1:11 ` redi at gcc dot gnu.org
  2014-06-04  6:23 ` akim.demaille at gmail dot com
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: redi at gcc dot gnu.org @ 2014-06-04  1:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Trunk still gives -Wsequence-point warnings, and PR 61382 has an example that
still fails


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (13 preceding siblings ...)
  2014-06-04  1:11 ` redi at gcc dot gnu.org
@ 2014-06-04  6:23 ` akim.demaille at gmail dot com
  2014-06-04 15:51 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: akim.demaille at gmail dot com @ 2014-06-04  6:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Akim Demaille <akim.demaille at gmail dot com> ---
(In reply to Jonathan Wakely from comment #13)
> (In reply to Akim Demaille from comment #10)
> >   auto t = std::make_tuple(incr(), incr());
> 
> That's not an initializer-list, it's a function call, so the order of
> evaluation is not specified and that example is not relevant AFAICT.

Yes, you are right, I had also realized that afterwards.  It would be
nice though if the standard could ensure that perfect forwarding could
preserve the guarantee on left-to-right "upward": convenience functions,
that wrap constructors for instance, could still be used safely.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (14 preceding siblings ...)
  2014-06-04  6:23 ` akim.demaille at gmail dot com
@ 2014-06-04 15:51 ` jason at gcc dot gnu.org
  2014-06-30 14:26 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2014-06-04 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Jun  4 15:51:01 2014
New Revision: 211235

URL: http://gcc.gnu.org/viewcvs?rev=211235&root=gcc&view=rev
Log:
    PR c++/51253
    PR c++/61382
gcc/
    * gimplify.c (gimplify_arg): Non-static.
    * gimplify.h: Declare it.
gcc/cp/
    * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPR_LIST_INIT_P here.
    * semantics.c (simplify_aggr_init_expr): Not here, just copy it.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist86.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-gimplify.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/gimplify.c
    trunk/gcc/gimplify.h


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (15 preceding siblings ...)
  2014-06-04 15:51 ` jason at gcc dot gnu.org
@ 2014-06-30 14:26 ` jason at gcc dot gnu.org
  2014-07-01  8:20 ` christophe.lyon at st dot com
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2014-06-30 14:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Mon Jun 30 14:25:21 2014
New Revision: 212150

URL: https://gcc.gnu.org/viewcvs?rev=212150&root=gcc&view=rev
Log:
    DR 1030
    PR c++/51253
    PR c++/61382
    * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
    * call.c (struct z_candidate): Add flags field.
    (add_candidate): Add flags parm.
    (add_function_candidate, add_conv_candidate, build_builtin_candidate)
    (add_template_candidate_real): Pass it.
    (build_over_call): Set CALL_EXPR_LIST_INIT_P.
    * tree.c (build_aggr_init_expr): Copy it.
    * semantics.c (simplify_aggr_init_expr): Copy it.
    * cp-gimplify.c (cp_gimplify_expr): Handle it.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/initlist86.C
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/call.c
    branches/gcc-4_9-branch/gcc/cp/cp-gimplify.c
    branches/gcc-4_9-branch/gcc/cp/cp-tree.h
    branches/gcc-4_9-branch/gcc/cp/semantics.c
    branches/gcc-4_9-branch/gcc/cp/tree.c
    branches/gcc-4_9-branch/gcc/gimplify.c
    branches/gcc-4_9-branch/gcc/gimplify.h


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (16 preceding siblings ...)
  2014-06-30 14:26 ` jason at gcc dot gnu.org
@ 2014-07-01  8:20 ` christophe.lyon at st dot com
  2014-07-03  2:11 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: christophe.lyon at st dot com @ 2014-07-01  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

christophe.lyon at st dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |christophe.lyon at st dot com

--- Comment #18 from christophe.lyon at st dot com ---
On 4.9 branch, I've noticed that commit 212150 adds new FAILs on some
configurations. g++.dg/cpp0x/initlist86.C fails at execution in the following
cases (tested with qemu):
target                     mode  cpu
arm-none-eabi              arm   cortex-a9
arm-none-linux-gnueabi     arm   cortex-a9
arm-none-linux-gnueabi     thumb cortex-a9
arm-none-linux-gnueabihf   arm   cortex-a9
arm-none-linux-gnueabihf   thumb cortex-a9
arm-none-linux-gnueabihf   arm   cortex-a9
armeb-none-linux-gnueabihf arm   cortex-a9
armeb-none-linux-gnueabihf thumb cortex-a9
aarch64-none-linux

the same test passes when:
target                     mode  cpu
arm-none-eabi              thumb cortex-a9
aarch64-none-elf
aarch64_be-none-elf


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (17 preceding siblings ...)
  2014-07-01  8:20 ` christophe.lyon at st dot com
@ 2014-07-03  2:11 ` jason at gcc dot gnu.org
  2014-07-07 11:57 ` christophe.lyon at st dot com
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2014-07-03  2:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Jason Merrill <jason at gcc dot gnu.org> ---
That's odd.  Can you investigate further?


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (18 preceding siblings ...)
  2014-07-03  2:11 ` jason at gcc dot gnu.org
@ 2014-07-07 11:57 ` christophe.lyon at st dot com
  2014-08-01 18:53 ` jason at gcc dot gnu.org
  2014-08-06 18:36 ` dacamara.cameron at gmail dot com
  21 siblings, 0 replies; 23+ messages in thread
From: christophe.lyon at st dot com @ 2014-07-07 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from christophe.lyon at st dot com ---
The problem was fixed by Jakub's commit 212289.
Thanks.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (19 preceding siblings ...)
  2014-07-07 11:57 ` christophe.lyon at st dot com
@ 2014-08-01 18:53 ` jason at gcc dot gnu.org
  2014-08-06 18:36 ` dacamara.cameron at gmail dot com
  21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2014-08-01 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|4.10.0                      |4.9.1

--- Comment #21 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed in 4.9.1.


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

* [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses in braced-init-list
  2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
                   ` (20 preceding siblings ...)
  2014-08-01 18:53 ` jason at gcc dot gnu.org
@ 2014-08-06 18:36 ` dacamara.cameron at gmail dot com
  21 siblings, 0 replies; 23+ messages in thread
From: dacamara.cameron at gmail dot com @ 2014-08-06 18:36 UTC (permalink / raw)
  To: gcc-bugs

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

Cameron <dacamara.cameron at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dacamara.cameron at gmail dot com

--- Comment #22 from Cameron <dacamara.cameron at gmail dot com> ---
*** Bug 62036 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2014-08-06 18:36 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-21  4:24 [Bug c++/51253] New: [C++11][DR 1030] Evaluation order (sequenced-before relation) among intializer-clauses in braced-init-list ai.azuma at gmail dot com
2012-10-10  9:24 ` [Bug c++/51253] [C++11][DR 1030] Evaluation order (sequenced-before relation) among initializer-clauses " paolo.carlini at oracle dot com
2013-07-05 13:49 ` akim.demaille at gmail dot com
2013-07-05 15:06 ` paolo.carlini at oracle dot com
2013-08-13 17:07 ` broes.decat at gmail dot com
2013-10-23 16:38 ` st at quanttec dot com
2013-11-25 11:54 ` akim.demaille at gmail dot com
2014-01-18 16:12 ` akim.demaille at gmail dot com
2014-03-06 14:38 ` akim.demaille at gmail dot com
2014-03-13 17:07 ` paolo.carlini at oracle dot com
2014-03-13 17:40 ` manu at gcc dot gnu.org
2014-04-10  8:14 ` akim.demaille at gmail dot com
2014-04-11 17:09 ` jason at gcc dot gnu.org
2014-06-03  9:29 ` redi at gcc dot gnu.org
2014-06-04  1:11 ` redi at gcc dot gnu.org
2014-06-04  6:23 ` akim.demaille at gmail dot com
2014-06-04 15:51 ` jason at gcc dot gnu.org
2014-06-30 14:26 ` jason at gcc dot gnu.org
2014-07-01  8:20 ` christophe.lyon at st dot com
2014-07-03  2:11 ` jason at gcc dot gnu.org
2014-07-07 11:57 ` christophe.lyon at st dot com
2014-08-01 18:53 ` jason at gcc dot gnu.org
2014-08-06 18:36 ` dacamara.cameron at gmail 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).