[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #15 from Daniel Krügler --- (In reply to Daniel Krügler from comment #14) Furthermore the name hiding happening here template>> Function(F); needs to be fixed (it was not in your previous example): template>> Function(F);

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #14 from Daniel Krügler --- (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

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #13 from Jonathan Wakely --- 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 struct add_rvalue_re

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #12 from Daniel Krügler --- (In reply to Jonathan Wakely from comment #11) > Further reduced (clang gives the same error for this version): > > template struct enable_if { typedef void type; }; > template struct enable_if { }; Jonath

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #11 from Jonathan Wakely --- Further reduced (clang gives the same error for this version): struct false_type { enum { value=0 }; }; struct true_type { enum { value=1 }; }; template struct add_rvalue_reference { using type = T&

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #10 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #9) > > // template struct CheckResult : > std::true_type { }; Sorry, bugzilla wrapped that line, you'll need to join those lines or comment out the std::true_t

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #9 from Jonathan Wakely --- Somewhat reduced: #include template inline _Functor& __callable_functor(_Functor& __f) { return __f; } template struct Function; template struct Function { template using Invoke = decltype(_

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #8 from Jonathan Wakely --- 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 unqualif

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #7 from Daniel Krügler --- (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 clas

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #6 from Daniel Krügler --- (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

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #5 from Jonathan Wakely --- And it should only happen when instantiating the converting constructor template or converting assignment operator function, not when instantiating the class template.

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #4 from Jonathan Wakely --- (In reply to Daniel Krügler from comment #3) > I don't see a good > reasons why std::function should check std::is_convertible foo> when instantiating the class template. It's done to check the constraint i

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #3 from Daniel Krügler --- (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

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-10-01 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #2 from Jonathan Wakely --- We can fix it in the library by adding this to std::function template struct _CheckResult<_CallRes, _CallRes> : true_type { };

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-09-30 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 --- Comment #1 from Paolo Carlini --- 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 inside foo. Adding Daniel in CC, in case he wants to

[Bug c++/58569] Compilation error when a class contains multiple std::function

2013-09-28 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58569 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|