public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member
@ 2012-11-06 19:23 vince.rev at gmail dot com
  2012-11-06 19:37 ` [Bug c++/55223] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vince.rev at gmail dot com @ 2012-11-06 19:23 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55223
           Summary: [C++11] Default lambda expression of a templated class
                    member
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vince.rev@gmail.com


The following example returns a compiler error "internal compiler error : in
tsubst_copy, at cp/pt.c:11354". It occurs when the default std::function of a
templated class member is used :

//-----------------------------------------------------------
#include <iostream>
#include <functional>

template<typename T> struct C
{
    static T test(std::function<T(int)> f = [](int i){return i;})
    {return f(42);}
};

int main(int argc, char* argv[])
{
    C<int>::test(); // ERROR = internal compiler error : in tsubst_copy, at
cp/pt.c:11354
    C<int>::test([](int i){return i;}); // OK
    return 0;
}
//-----------------------------------------------------------

Tested on GCC 4.6.3 and 4.7.2.


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

* [Bug c++/55223] [C++11] Default lambda expression of a templated class member
  2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
@ 2012-11-06 19:37 ` redi at gcc dot gnu.org
  2013-01-20 19:03 ` ak at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2012-11-06 19:37 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-11-06
             Blocks|                            |54367
     Ever Confirmed|0                           |1
           Severity|major                       |normal

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-11-06 19:37:27 UTC ---
crashes in the same place as Bug 53486, but I think that's ice-on-invalid-code
and has a huge testcase, so let's keep this open


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

* [Bug c++/55223] [C++11] Default lambda expression of a templated class member
  2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
  2012-11-06 19:37 ` [Bug c++/55223] " redi at gcc dot gnu.org
@ 2013-01-20 19:03 ` ak at gcc dot gnu.org
  2013-01-20 19:56 ` daniel.kruegler at googlemail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ak at gcc dot gnu.org @ 2013-01-20 19:03 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from ak at gcc dot gnu.org 2013-01-20 19:03:29 UTC ---
Author: ak
Date: Sun Jan 20 19:03:22 2013
New Revision: 195321

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195321
Log:
libstdc++: Add mem_order_hle_acquire/release to atomic.h v2

The underlying compiler supports additional __ATOMIC_HLE_ACQUIRE/RELEASE
memmodel flags for TSX, but this was not exposed to the C++ wrapper.
Handle it there.

These are additional flags, so some of assert checks need to mask
off the flags before checking the memory model type.

libstdc++-v3/:
2013-01-12  Andi Kleen  <ak@linux.intel.com>
        Jonathan Wakely  <jwakely.gcc@gmail.com>

        PR libstdc++/55223
    * include/bits/atomic_base.h (__memory_order_modifier): Add
    __memory_order_mask, __memory_order_modifier_mask,
    __memory_order_hle_acquire, __memory_order_hle_release.
    (operator|,operator&): Add.
    (__cmpexch_failure_order):  Rename to __cmpexch_failure_order2.
    (__cmpexch_failure_order): Add.
    (clear, store, load, compare_exchange_weak, compare_exchange_strong):
    Handle flags.
    * testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
    Add.

Added:
   
trunk/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/atomic_base.h


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

* [Bug c++/55223] [C++11] Default lambda expression of a templated class member
  2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
  2012-11-06 19:37 ` [Bug c++/55223] " redi at gcc dot gnu.org
  2013-01-20 19:03 ` ak at gcc dot gnu.org
@ 2013-01-20 19:56 ` daniel.kruegler at googlemail dot com
  2013-01-20 20:04 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-01-20 19:56 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-01-20 19:56:22 UTC ---
(In reply to comment #2)
> The underlying compiler supports additional __ATOMIC_HLE_ACQUIRE/RELEASE
> memmodel flags for TSX, but this was not exposed to the C++ wrapper.
> Handle it there.

I'm confused: This comment seems not to match to the issue problem. Could it be
that it should refer to another issue?


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

* [Bug c++/55223] [C++11] Default lambda expression of a templated class member
  2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
                   ` (2 preceding siblings ...)
  2013-01-20 19:56 ` daniel.kruegler at googlemail dot com
@ 2013-01-20 20:04 ` redi at gcc dot gnu.org
  2013-02-15  1:27 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2013-01-20 20:04 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-01-20 20:04:30 UTC ---
Typo in the commit, it should be PR 55233


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

* [Bug c++/55223] [C++11] Default lambda expression of a templated class member
  2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
                   ` (3 preceding siblings ...)
  2013-01-20 20:04 ` redi at gcc dot gnu.org
@ 2013-02-15  1:27 ` jason at gcc dot gnu.org
  2013-02-15 11:19 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2013-02-15  1:27 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2013-02-15 01:26:49 UTC ---
Author: jason
Date: Fri Feb 15 01:26:44 2013
New Revision: 196065

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196065
Log:
    PR c++/55223
gcc/cp/
    * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
    default argument scope.
    * mangle.c (write_name): Likewise.
libiberty/
    * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_DEFAULT_ARG.
    (d_print_comp): Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg3.C
Modified:
    trunk/gcc/common.opt
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/mangle.c
    trunk/gcc/cp/pt.c
    trunk/libiberty/ChangeLog
    trunk/libiberty/cp-demangle.c
    trunk/libiberty/testsuite/demangle-expected


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

* [Bug c++/55223] [C++11] Default lambda expression of a templated class member
  2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
                   ` (4 preceding siblings ...)
  2013-02-15  1:27 ` jason at gcc dot gnu.org
@ 2013-02-15 11:19 ` paolo.carlini at oracle dot com
  2013-02-15 11:47 ` paolo.carlini at oracle dot com
  2013-02-15 12:05 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-02-15 11:19 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-02-15 11:19:09 UTC ---
Fixed.


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

* [Bug c++/55223] [C++11] Default lambda expression of a templated class member
  2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
                   ` (5 preceding siblings ...)
  2013-02-15 11:19 ` paolo.carlini at oracle dot com
@ 2013-02-15 11:47 ` paolo.carlini at oracle dot com
  2013-02-15 12:05 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-02-15 11:47 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |naddiseo at gmail dot com

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-02-15 11:47:06 UTC ---
*** Bug 51833 has been marked as a duplicate of this bug. ***


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

* [Bug c++/55223] [C++11] Default lambda expression of a templated class member
  2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
                   ` (6 preceding siblings ...)
  2013-02-15 11:47 ` paolo.carlini at oracle dot com
@ 2013-02-15 12:05 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-02-15 12:05 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jpalecek at web dot de

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-02-15 12:05:03 UTC ---
*** Bug 53486 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2013-02-15 12:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-06 19:23 [Bug c++/55223] New: [C++11] Default lambda expression of a templated class member vince.rev at gmail dot com
2012-11-06 19:37 ` [Bug c++/55223] " redi at gcc dot gnu.org
2013-01-20 19:03 ` ak at gcc dot gnu.org
2013-01-20 19:56 ` daniel.kruegler at googlemail dot com
2013-01-20 20:04 ` redi at gcc dot gnu.org
2013-02-15  1:27 ` jason at gcc dot gnu.org
2013-02-15 11:19 ` paolo.carlini at oracle dot com
2013-02-15 11:47 ` paolo.carlini at oracle dot com
2013-02-15 12:05 ` 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).