public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function
@ 2013-09-28 20:16 pierre.krieger1708 at gmail dot com
  2013-09-28 23:53 ` [Bug c++/58569] Compilation error when a class " redi at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: pierre.krieger1708 at gmail dot com @ 2013-09-28 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58569
           Summary: Compilation error when copying class which contains
                    multiple std::function
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pierre.krieger1708 at gmail dot com

Created attachment 30924
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30924&action=edit
The preprocessed file

This simple code snippet fails to compile:


#include <functional>

struct foo {
  std::function<foo (int)> x;
  std::function<foo ()> y;
};

int main(int argc, char const* argv[]) {
  foo a;  
  return 0;
}


The problem happens if a class contains at least two std::function of different
type which return the class itself.

If you remove the "int" from "foo (int)", it works. If you remove either member
"x" or "y", it works.


With g++4.8.1 and flag -std=c++11:

In file included from test.cpp:1:0:
/usr/include/c++/4.8/functional: In instantiation of ‘struct
std::function<foo()>::_CheckResult<foo, foo>’:
/usr/include/c++/4.8/functional:2192:63:   required by substitution of
‘template<class _Res, class ... _ArgTypes> template<class _Cond, class _Tp>
using _Requires = typename std::enable_if<_Cond:: value, _Tp>::type [with _Cond
= std::function<foo()>::_CheckResult<foo, foo>; _Tp = void; _Res = foo;
_ArgTypes = {}]’
/usr/include/c++/4.8/functional:2254:9:   required by substitution of
‘template<class _From1, class _To1> static decltype
((__test_aux<_To1>(declval<_From1>()), std::__sfinae_types::__one()))
std::__is_convertible_helper<_From, _To, false>::__test(int) [with _From1 =
_From1; _To1 = _To1; _From = foo; _To = foo] [with _From1 = foo; _To1 = foo]’
/usr/include/c++/4.8/type_traits:1312:50:   required from ‘constexpr const bool
std::__is_convertible_helper<foo, foo, false>::value’
/usr/include/c++/4.8/type_traits:1317:12:   required from ‘struct
std::is_convertible<foo, foo>’
/usr/include/c++/4.8/functional:2181:9:   required from ‘struct
std::function<foo(int)>::_CheckResult<foo, foo>’
/usr/include/c++/4.8/functional:2192:63:   required by substitution of
‘template<class _Res, class ... _ArgTypes> template<class _Cond, class _Tp>
using _Requires = typename std::enable_if<_Cond:: value, _Tp>::type [with _Cond
= std::function<foo(int)>::_CheckResult<foo, foo>; _Tp = void; _Res = foo;
_ArgTypes = {int}]’
/usr/include/c++/4.8/functional:2254:9:   required from here
/usr/include/c++/4.8/functional:2181:9: error: invalid use of incomplete type
‘struct std::is_convertible<foo, foo>’
  struct _CheckResult
         ^
In file included from /usr/include/c++/4.8/bits/move.h:57:0,
                 from /usr/include/c++/4.8/bits/stl_pair.h:59,
                 from /usr/include/c++/4.8/utility:70,
                 from /usr/include/c++/4.8/tuple:38,
                 from /usr/include/c++/4.8/functional:55,
                 from test.cpp:1:
/usr/include/c++/4.8/type_traits:1317:12: error: declaration of ‘struct
std::is_convertible<foo, foo>’
     struct is_convertible
            ^
/usr/include/c++/4.8/type_traits: In substitution of ‘template<class _From1,
class _To1> static decltype ((__test_aux<_To1>(declval<_From1>()),
std::__sfinae_types::__one())) std::__is_convertible_helper<_From, _To,
false>::__test(int) [with _From1 = _From1; _To1 = _To1; _From = foo; _To = foo]
[with _From1 = foo; _To1 = foo]’:
/usr/include/c++/4.8/type_traits:1312:50:   required from ‘constexpr const bool
std::__is_convertible_helper<foo, foo, false>::value’
/usr/include/c++/4.8/type_traits:1317:12:   required from ‘struct
std::is_convertible<foo, foo>’
/usr/include/c++/4.8/functional:2181:9:   required from ‘struct
std::function<foo(int)>::_CheckResult<foo, foo>’
/usr/include/c++/4.8/functional:2192:63:   required by substitution of
‘template<class _Res, class ... _ArgTypes> template<class _Cond, class _Tp>
using _Requires = typename std::enable_if<_Cond:: value, _Tp>::type [with _Cond
= std::function<foo(int)>::_CheckResult<foo, foo>; _Tp = void; _Res = foo;
_ArgTypes = {int}]’
/usr/include/c++/4.8/functional:2254:9:   required from here
/usr/include/c++/4.8/type_traits:1302:21: error:   initializing argument 1 of
‘static void std::__is_convertible_helper<_From, _To, false>::__test_aux(_To1)
[with _To1 = foo; _From = foo; _To = foo]’
         static void __test_aux(_To1);
>From gcc-bugs-return-430734-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Sep 28 20:17:58 2013
Return-Path: <gcc-bugs-return-430734-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4291 invoked by alias); 28 Sep 2013 20:17:58 -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 4256 invoked by uid 48); 28 Sep 2013 20:17:55 -0000
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58500] [C++1y] Crash with auto in function parameter
Date: Sat, 28 Sep 2013 20:17: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: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: reichelt at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_known_to_work resolution target_milestone
Message-ID: <bug-58500-4-HN5xNBXEqs@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58500-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58500-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: 2013-09/txt/msg01974.txt.bz2
Content-length: 557

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |4.9.0
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

--- Comment #3 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
Fixed by Adam's patch.


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
@ 2013-09-28 23:53 ` redi at gcc dot gnu.org
  2013-10-01  6:39 ` paolo.carlini at oracle dot com
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-09-28 23:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-09-28
     Ever confirmed|0                           |1


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
  2013-09-28 23:53 ` [Bug c++/58569] Compilation error when a class " redi at gcc dot gnu.org
@ 2013-10-01  6:39 ` paolo.carlini at oracle dot com
  2013-10-01  7:01 ` redi at gcc dot gnu.org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-10-01  6:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
We badly need a reduced testcase for this. The issue doesn't seem to involve
std::function in a fundamental way, seems more about using
std::is_convertible<foo, foo> inside foo.

Adding Daniel in CC, in case he wants to help for the reduction...


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
  2013-09-28 23:53 ` [Bug c++/58569] Compilation error when a class " redi at gcc dot gnu.org
  2013-10-01  6:39 ` paolo.carlini at oracle dot com
@ 2013-10-01  7:01 ` redi at gcc dot gnu.org
  2013-10-01  7:11 ` daniel.kruegler at googlemail dot com
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-01  7:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We can fix it in the library by adding this to std::function

      template<typename _CallRes>
    struct _CheckResult<_CallRes, _CallRes>
    : true_type { };


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (2 preceding siblings ...)
  2013-10-01  7:01 ` redi at gcc dot gnu.org
@ 2013-10-01  7:11 ` daniel.kruegler at googlemail dot com
  2013-10-01  7:46 ` redi at gcc dot gnu.org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-10-01  7:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Paolo Carlini from comment #1)
[Somehow bugzilla lost my response] 
Yes, foo is incomplete within a data member declaration of type foo and this
breaks std::is_convertible, because the arguments are not complete types. On
the other hand the user seems not to violate 17.6.4.8 [res.on.functions],
because foo() and foo(int) are both complete types. I don't see a good reasons
why std::function<foo(...)> should check std::is_convertible<foo, foo> when
instantiating the class template.
>From gcc-bugs-return-430866-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 01 07:33:02 2013
Return-Path: <gcc-bugs-return-430866-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10514 invoked by alias); 1 Oct 2013 07:33:02 -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 10404 invoked by uid 48); 1 Oct 2013 07:32:58 -0000
From: "kuganv at linaro dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/58578] [4.9 Regression] mpfr tasinh test doesn't terminate when built with trunk for ARM
Date: Tue, 01 Oct 2013 07:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: other
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: kuganv at linaro dot org
X-Bugzilla-Status: WAITING
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58578-4-MD0BTtU9RL@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58578-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58578-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: 2013-10/txt/msg00010.txt.bz2
Content-length: 652

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

--- Comment #3 from Kugan <kuganv at linaro dot org> ---
gcc -v
Using built-in specs.
COLLECT_GCC=/home/kugan/work/install-trunk/bin/gcc
COLLECT_LTO_WRAPPER=/home/kugan/work/install-trunk/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.9.0/lto-wrapper
Target: armv7l-unknown-linux-gnueabihf
Configured with: ../trunk/configure --target=armv7l-unknown-linux-gnueabihf
--host=armv7l-unknown-linux-gnueabihf --build=armv7l-unknown-linux-gnueabihf
--prefix=/home/kugan/work/install-trunk --with-float=hard
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.9.0 20130922 (experimental) (GCC)


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (3 preceding siblings ...)
  2013-10-01  7:11 ` daniel.kruegler at googlemail dot com
@ 2013-10-01  7:46 ` redi at gcc dot gnu.org
  2013-10-01  7:49 ` daniel.kruegler at googlemail dot com
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-01  7:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Daniel Krügler from comment #3)
> I don't see a good
> reasons why std::function<foo(...)> should check std::is_convertible<foo,
> foo> when instantiating the class template.

It's done to check the constraint imposed by the resolution of
http://cplusplus.github.io/LWG/lwg-active.html#2132
>From gcc-bugs-return-430870-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 01 07:47:21 2013
Return-Path: <gcc-bugs-return-430870-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24612 invoked by alias); 1 Oct 2013 07:47:21 -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 24576 invoked by uid 48); 1 Oct 2013 07:47:18 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58569] Compilation error when a class contains multiple std::function
Date: Tue, 01 Oct 2013 07:47: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.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58569-4-50Iz7ZKkKZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58569-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58569-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: 2013-10/txt/msg00014.txt.bz2
Content-length: 286

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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And it should only happen when instantiating the converting constructor
template or converting assignment operator function, not when instantiating the
class template.


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (4 preceding siblings ...)
  2013-10-01  7:46 ` redi at gcc dot gnu.org
@ 2013-10-01  7:49 ` daniel.kruegler at googlemail dot com
  2013-10-01  8:04 ` redi at gcc dot gnu.org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-10-01  7:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #4)

Why would LWG 2132 require any such check during the instantiation of the class
template or during the instantiation of the default constructor? The
constraints are only imposed on template members.
>From gcc-bugs-return-430872-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 01 07:50:18 2013
Return-Path: <gcc-bugs-return-430872-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27441 invoked by alias); 1 Oct 2013 07:50:18 -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 27395 invoked by uid 48); 1 Oct 2013 07:50:14 -0000
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58569] Compilation error when a class contains multiple std::function
Date: Tue, 01 Oct 2013 07:50: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.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: daniel.kruegler at googlemail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58569-4-G5POYcjOPZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58569-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58569-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg00016.txt.bz2
Content-length: 403

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

--- Comment #7 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #5)
> And it should only happen when instantiating the converting constructor
> template or converting assignment operator function, not when instantiating
> the class template.

Thanks, that is the point I was missing.
>From gcc-bugs-return-430873-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 01 07:58:36 2013
Return-Path: <gcc-bugs-return-430873-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 32457 invoked by alias); 1 Oct 2013 07:58:36 -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 32400 invoked by uid 48); 1 Oct 2013 07:58:31 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/58580] [4.8/4.9 Regression] preprocessor goes OOM with warning for zero literals
Date: Tue, 01 Oct 2013 07:58:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-58580-4-P9r6AxMsvh@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58580-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58580-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: 2013-10/txt/msg00017.txt.bz2
Content-length: 2962

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Also fixed with -fno-diagnostic-show-caret.  ltrace shows

fputs("test.cpp:3:1: warning: null char"..., 0x7fbaa148c700test.cpp:3:1:
warning: null character(s) preserved in literal [enabled by default]
) = 1
fflush(0x7fbaa148c700)                           = 0
memcpy(0x0378c04f, """, 3)                       = 0x0378c04f
memcpy(0x037f2a40, "\003", 16)                   = 0x037f2a40
__errno_location()                               = 0x7fbaa21db698
malloc(19)                                       = 0x0375dc60
memcpy(0x0375dc60, "enabled by default", 19)     = 0x0375dc60
memcpy(0x7ffff4e3bc60, "null character(s) preserved in l"..., 38) 0x7ffff4e3bc60
memcpy(0x7ffff4e3bc86, " ", 1)                   = 0x7ffff4e3bc86
memcpy(0x7ffff4e3bc87, "[", 1)                   = 0x7ffff4e3bc87
memcpy(0x7ffff4e3bc88, "enabled by default", 18) = 0x7ffff4e3bc88
memcpy(0x7ffff4e3bc9a, "]", 1)                   = 0x7ffff4e3bc9a
free(0x0375dc60)                                 = <void>
memset(0x7ffff4e3b990, '\000', 240)              = 0x7ffff4e3b990
vasprintf(0x7ffff4e3bae8, 0x19eed82, 0x7ffff4e3bad0, 0x19eed82, 1) = 23
strlen("null character(s) preserved in l"...)    = 59
strlen("test.cpp:4:1: warning: ")                = 23
memcpy(0x03784ac0, "test.cpp:4:1: warning: ", 23) = 0x03784ac0
memcpy(0x03784ad7, "null character(s) preserved in l"..., 59) = 0x03784ad7
fopen("test.cpp", "r")                           = 0x37c07c0
fgets("", -1575075836, 0x37c08a0)                = 0x7fbaa040f010
realloc(0x7fbaa040f010, 13107200)                = 0x7fba9f78e010
fgets("", -1575075832, 0x37c08a0)                = 0x7fba9f78e011
realloc(0x7fba9f78e010, 26214400)                = 0x7fba9de8d010
fgets("", -1575075828, 0x37c08a0)                = 0x7fba9de8d012
realloc(0x7fba9de8d010, 52428800)                = 0x7fba9ac8c010
fgets("", -1575075824, 0x37c08a0)                = 0x7fba9ac8c013
realloc(0x7fba9ac8c010, 104857600)               = 0x7fba9488b010
fgets("", -1575075820, 0x37c08a0)                = 0x7fba9488b014
realloc(0x7fba9488b010, 209715200)               = 0x7fba8808a010
fgets("\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"...,
-1575075840, 0x37c08a0) = NULL
fgets("\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"...,
-1575075840, 0x37c08a0) = NULL
fclose(0x37c07c0)                                = 0

so it seems to go completely bollocks re-reading from the source for displaying
the offending line.


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (5 preceding siblings ...)
  2013-10-01  7:49 ` daniel.kruegler at googlemail dot com
@ 2013-10-01  8:04 ` redi at gcc dot gnu.org
  2013-10-01  8:10 ` redi at gcc dot gnu.org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-01  8:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This might be a front-end bug, I'm struggling to reduce it though.

If I produce prepreocessed code then clang++ compiles it fine.

Adding this to the global namespace (so that version gets found by unqualified
lookup instead of std::__callable_function) fixes the error:

template<typename _Functor>
  inline _Functor&
  __callable_functor(_Functor& __f)
  { return __f; }

So there seems to be some interaction with the std::__callable_function
overloads.


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (6 preceding siblings ...)
  2013-10-01  8:04 ` redi at gcc dot gnu.org
@ 2013-10-01  8:10 ` redi at gcc dot gnu.org
  2013-10-01  8:12 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-01  8:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Somewhat reduced:

#include <type_traits>

template<typename _Functor>
  inline _Functor&
  __callable_functor(_Functor& __f)
  { return __f; }

template<typename S> struct Function;

template<typename R, typename... A>
struct Function<R(A...)>
{
  template<typename F>
    using Invoke = decltype(__callable_functor(std::declval<F&>())
                            (std::declval<A>()...) );

  template<typename CallRes, typename Res1>
    struct CheckResult
    : std::is_convertible<CallRes, Res1> { };

  // template<typename CallRes> struct CheckResult<CallRes, CallRes> :
std::true_type { };

  template<typename F>
    using Callable = CheckResult<Invoke<F>, R>;

  template<typename Cond, typename T>
    using Requires = typename std::enable_if<Cond::value, T>::type;

  template<typename F, typename = Requires<Callable<F>, void>>
    Function(F);

  Function();

  R operator()(A...) const;
};

struct foo {
  Function<foo (int)> x;
  Function<foo ()> y;
};

int main() {
  foo a;
}


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (7 preceding siblings ...)
  2013-10-01  8:10 ` redi at gcc dot gnu.org
@ 2013-10-01  8:12 ` redi at gcc dot gnu.org
  2013-10-01  8:26 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-01  8:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #9)
> 
>   // template<typename CallRes> struct CheckResult<CallRes, CallRes> :
> std::true_type { };

Sorry, bugzilla wrapped that line, you'll need to join those lines or comment
out the std::true_type too.  Uncommenting it makes it compile.


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (8 preceding siblings ...)
  2013-10-01  8:12 ` redi at gcc dot gnu.org
@ 2013-10-01  8:26 ` redi at gcc dot gnu.org
  2013-10-01  8:32 ` daniel.kruegler at googlemail dot com
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-01  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Further reduced (clang gives the same error for this version):

struct false_type { enum { value=0 }; };
struct true_type { enum { value=1 }; };

template<typename T>
  struct add_rvalue_reference {
    using type = T&&;
  };

template<typename _Tp>
  typename add_rvalue_reference<_Tp>::type declval() noexcept;

template<typename _From, typename _To>
  class __is_convertible_helper
  {
     template<typename _To1>
      static void __test_aux(_To1);

    template<typename _From1, typename _To1,
             typename = decltype(__test_aux<_To1>(declval<_From1>()))>
      static true_type
      __test(int);

    template<typename, typename>
      static false_type
      __test(...);

  public:
    typedef decltype(__test<_From, _To>(0)) type;
  };

/// is_convertible
template<typename _From, typename _To>
  struct is_convertible
  : public __is_convertible_helper<_From, _To>::type
  { };

template<bool B> struct enable_if { typedef void type; };
template<typename T> struct enable_if<false, T> { };

template<typename _Functor>
  inline _Functor&
  __callable_functor(_Functor& __f)
  { return __f; }

template<typename S> struct Function;

template<typename R, typename... A>
struct Function<R(A...)>
{
  template<typename F>
    using Invoke = decltype(__callable_functor(declval<F&>())
                            (declval<A>()...) );

  template<typename CallRes, typename Res1>
    struct CheckResult
    : is_convertible<CallRes, Res1> { };

  // template<typename CR> struct CheckResult<CR, CR> : true_type { };

  template<typename F>
    using Callable = CheckResult<Invoke<F>, R>;

  template<typename Cond>
    using Requires = typename enable_if<Cond::value>::type;

  template<typename F, typename = Requires<Callable<F>>>
    Function(F);

  Function();

  R operator()(A...) const;
};

struct foo {
  Function<foo (int)> x;
  Function<foo ()> y;
};

int main() {
  foo a;
}


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (9 preceding siblings ...)
  2013-10-01  8:26 ` redi at gcc dot gnu.org
@ 2013-10-01  8:32 ` daniel.kruegler at googlemail dot com
  2013-10-01  8:52 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-10-01  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #11)
> Further reduced (clang gives the same error for this version):
> 
> template<bool B> struct enable_if { typedef void type; };
> template<typename T> struct enable_if<false, T> { };

Jonathan, this must be a typo!
>From gcc-bugs-return-430881-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 01 08:34:22 2013
Return-Path: <gcc-bugs-return-430881-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4359 invoked by alias); 1 Oct 2013 08:34:22 -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 4304 invoked by uid 48); 1 Oct 2013 08:34:18 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/58585] [4.9 Regression] ICE in ipa with virtual inheritance
Date: Tue, 01 Oct 2013 08:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc target_milestone
Message-ID: <bug-58585-4-BREpjuZFMW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58585-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58585-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: 2013-10/txt/msg00025.txt.bz2
Content-length: 369

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org
   Target Milestone|---                         |4.9.0


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (10 preceding siblings ...)
  2013-10-01  8:32 ` daniel.kruegler at googlemail dot com
@ 2013-10-01  8:52 ` redi at gcc dot gnu.org
  2013-10-01  8:57 ` daniel.kruegler at googlemail dot com
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-01  8:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Argh, yes, I didn't read the diagnostic properly after that last change, sorry!

Corrected:

struct false_type { enum { value=0 }; };
struct true_type { enum { value=1 }; };

template<typename T>
  struct add_rvalue_reference {
    using type = T&&;
  };

template<typename _Tp>
  typename add_rvalue_reference<_Tp>::type declval() noexcept;

template<typename _From, typename _To>
  class is_convertible
  {
     template<typename _To1>
      static void __test_aux(_To1);

    template<typename _From1, typename _To1,
             typename = decltype(__test_aux<_To1>(declval<_From1>()))>
      static true_type
      __test(int);

    template<typename, typename>
      static false_type
      __test(...);

  public:
    typedef decltype(__test<_From, _To>(0)) type;
  };

template<bool B> struct enable_if { typedef void type; };
template<> struct enable_if<false> { };

template<typename _Functor>
  inline _Functor&
  __callable_functor(_Functor& __f)
  { return __f; }

template<typename S> struct Function;

template<typename R, typename... A>
struct Function<R(A...)>
{
  template<typename F>
    using Invoke = decltype(__callable_functor(declval<F&>())
                            (declval<A>()...) );

  template<typename CallRes, typename Res1>
    struct CheckResult
    : is_convertible<CallRes, Res1> { };

  // template<typename CR> struct CheckResult<CR, CR> : true_type { };

  template<typename F>
    using Callable = CheckResult<Invoke<F>, R>;

  template<typename Cond>
    using Requires = typename enable_if<Cond::value>::type;

  template<typename F, typename R = Requires<Callable<F>>>
    Function(F);

  Function();

  R operator()(A...) const;
};

struct foo {
  Function<foo (int)> x;
  Function<foo ()> y;
};

int main() {
  foo a;
}


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (11 preceding siblings ...)
  2013-10-01  8:52 ` redi at gcc dot gnu.org
@ 2013-10-01  8:57 ` daniel.kruegler at googlemail dot com
  2013-10-01  9:17 ` daniel.kruegler at googlemail dot com
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-10-01  8:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #13)
> Argh, yes, I didn't read the diagnostic properly after that last change,
> sorry!

Thanks. I think the actual problem can be resolve by moving

  template<typename CallRes, typename Res1>
    struct CheckResult
    : is_convertible<CallRes, Res1> { };

out of the template. When this template is instantiated within the outer class,
the result is still an incomplete type. I think there was a core issue with
that out come.
>From gcc-bugs-return-430884-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 01 09:09:42 2013
Return-Path: <gcc-bugs-return-430884-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29517 invoked by alias); 1 Oct 2013 09:09:42 -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 29484 invoked by uid 48); 1 Oct 2013 09:09:40 -0000
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/58579] Memory allocation fails when calling character-valued function
Date: Tue, 01 Oct 2013 09:09:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: burnus at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: burnus at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on assigned_to everconfirmed
Message-ID: <bug-58579-4-lXKIR2gPEE@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58579-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58579-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: 2013-10/txt/msg00028.txt.bz2
Content-length: 664

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-10-01
           Assignee|unassigned at gcc dot gnu.org      |burnus at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
TAKE the bug: I have a patch. (A bit different from the quite bogus one in
comment 2, but for the same spot.)


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

* [Bug c++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (12 preceding siblings ...)
  2013-10-01  8:57 ` daniel.kruegler at googlemail dot com
@ 2013-10-01  9:17 ` daniel.kruegler at googlemail dot com
  2013-10-01 13:01 ` [Bug libstdc++/58569] " paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-10-01  9:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Daniel Krügler from comment #14)
Furthermore the name hiding happening here

template<typename F, typename R = Requires<Callable<F>>>
    Function(F);

needs to be fixed (it was not in your previous example):

template<typename F, typename = Requires<Callable<F>>>
    Function(F);
>From gcc-bugs-return-430886-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 01 09:22:18 2013
Return-Path: <gcc-bugs-return-430886-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16441 invoked by alias); 1 Oct 2013 09:22:18 -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 15891 invoked by uid 48); 1 Oct 2013 09:22:13 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58569] Compilation error when a class contains multiple std::function
Date: Tue, 01 Oct 2013 09:22:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: redi at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status component assigned_to
Message-ID: <bug-58569-4-39TcTCefhj@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58569-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58569-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg00030.txt.bz2
Content-length: 1505

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
          Component|c++                         |libstdc++
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org

--- Comment #16 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Daniel Krügler from comment #14)
> Thanks. I think the actual problem can be resolve by moving
> 
>   template<typename CallRes, typename Res1>
>     struct CheckResult
>     : is_convertible<CallRes, Res1> { };
> 
> out of the template. When this template is instantiated within the outer
> class, the result is still an incomplete type. I think there was a core
> issue with that out come.

OK, thanks, I'll do that.

(In reply to Daniel Krügler from comment #15)
> (In reply to Daniel Krügler from comment #14)
> Furthermore the name hiding happening here
> 
> template<typename F, typename R = Requires<Callable<F>>>
>     Function(F);
> 
> needs to be fixed (it was not in your previous example):
> 
> template<typename F, typename = Requires<Callable<F>>>
>     Function(F);

Yes, I think my X server is interacting badly with the Windows clipboard, I
pasted an older version of the code with the shadowed, not what I thought I'd
copied, sorry again!
>From gcc-bugs-return-430887-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 01 09:24:38 2013
Return-Path: <gcc-bugs-return-430887-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20553 invoked by alias); 1 Oct 2013 09:24:38 -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 20482 invoked by uid 48); 1 Oct 2013 09:24:35 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/58585] [4.9 Regression] ICE in ipa with virtual inheritance
Date: Tue, 01 Oct 2013 09:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-58585-4-Zr8s8bwadu@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58585-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58585-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: 2013-10/txt/msg00031.txt.bz2
Content-length: 570

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-10-01
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

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


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

* [Bug libstdc++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (13 preceding siblings ...)
  2013-10-01  9:17 ` daniel.kruegler at googlemail dot com
@ 2013-10-01 13:01 ` paolo.carlini at oracle dot com
  2013-10-02 20:22 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-10-01 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Thanks!


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

* [Bug libstdc++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (15 preceding siblings ...)
  2013-10-02 20:22 ` redi at gcc dot gnu.org
@ 2013-10-02 20:22 ` redi at gcc dot gnu.org
  2013-10-02 20:23 ` redi at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-02 20:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Wed Oct  2 20:22:02 2013
New Revision: 203133

URL: http://gcc.gnu.org/viewcvs?rev=203133&root=gcc&view=rev
Log:
2013-10-02  Jonathan Wakely  <jwakely.gcc@gmail.com>
        Daniel Krugler  <daniel.kruegler@gmail.com>

    PR libstdc++/58569
    * include/std/functional (function::_CheckResult): Move to namespace
    scope and rename to __check_func_return_type.
    * testsuite/20_util/function/58569.cc: New.

Added:
    branches/gcc-4_8-branch/libstdc++-v3/testsuite/20_util/function/58569.cc
Modified:
    branches/gcc-4_8-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_8-branch/libstdc++-v3/include/std/functional


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

* [Bug libstdc++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (14 preceding siblings ...)
  2013-10-01 13:01 ` [Bug libstdc++/58569] " paolo.carlini at oracle dot com
@ 2013-10-02 20:22 ` redi at gcc dot gnu.org
  2013-10-02 20:22 ` redi at gcc dot gnu.org
  2013-10-02 20:23 ` redi at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-02 20:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Wed Oct  2 20:21:52 2013
New Revision: 203132

URL: http://gcc.gnu.org/viewcvs?rev=203132&root=gcc&view=rev
Log:
2013-10-02  Jonathan Wakely  <jwakely.gcc@gmail.com>
        Daniel Krugler  <daniel.kruegler@gmail.com>

    PR libstdc++/58569
    * include/std/functional (function::_CheckResult): Move to namespace
    scope and rename to __check_func_return_type.
    * testsuite/20_util/function/58569.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/20_util/function/58569.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/std/functional


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

* [Bug libstdc++/58569] Compilation error when a class contains multiple std::function
  2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
                   ` (16 preceding siblings ...)
  2013-10-02 20:22 ` redi at gcc dot gnu.org
@ 2013-10-02 20:23 ` redi at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-02 20:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.8.2

--- Comment #20 from Jonathan Wakely <redi at gcc dot gnu.org> ---
fixed for 4.8.2 and 4.9.0


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

end of thread, other threads:[~2013-10-02 20:23 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-28 20:16 [Bug c++/58569] New: Compilation error when copying class which contains multiple std::function pierre.krieger1708 at gmail dot com
2013-09-28 23:53 ` [Bug c++/58569] Compilation error when a class " redi at gcc dot gnu.org
2013-10-01  6:39 ` paolo.carlini at oracle dot com
2013-10-01  7:01 ` redi at gcc dot gnu.org
2013-10-01  7:11 ` daniel.kruegler at googlemail dot com
2013-10-01  7:46 ` redi at gcc dot gnu.org
2013-10-01  7:49 ` daniel.kruegler at googlemail dot com
2013-10-01  8:04 ` redi at gcc dot gnu.org
2013-10-01  8:10 ` redi at gcc dot gnu.org
2013-10-01  8:12 ` redi at gcc dot gnu.org
2013-10-01  8:26 ` redi at gcc dot gnu.org
2013-10-01  8:32 ` daniel.kruegler at googlemail dot com
2013-10-01  8:52 ` redi at gcc dot gnu.org
2013-10-01  8:57 ` daniel.kruegler at googlemail dot com
2013-10-01  9:17 ` daniel.kruegler at googlemail dot com
2013-10-01 13:01 ` [Bug libstdc++/58569] " paolo.carlini at oracle dot com
2013-10-02 20:22 ` redi at gcc dot gnu.org
2013-10-02 20:22 ` redi at gcc dot gnu.org
2013-10-02 20:23 ` redi at gcc dot gnu.org

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).