public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails
@ 2011-03-14 14:02 martin.kronbichler at it dot uu.se
2011-03-14 14:09 ` [Bug libstdc++/48113] " redi at gcc dot gnu.org
` (14 more replies)
0 siblings, 15 replies; 16+ messages in thread
From: martin.kronbichler at it dot uu.se @ 2011-03-14 14:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Summary: [C++0x] bind with tuple argument fails
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: martin.kronbichler@it.uu.se
Compiler version:
$ gcc-4.6 -v
Using built-in specs.
COLLECT_GCC=gcc-4.6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../configure --enable-languages=c,c++,fortran,objc,obj-c++,go
--prefix=/usr --libexecdir=/usr/lib --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --without-included-gettext
--enable-threads=posix --program-suffix=-4.6 --enable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror
--with-arch-32=i486 --with-tune=core2 --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-cpu=core2
Thread model: posix
gcc version 4.6.0 20110312 (experimental) (GCC)
(weekly snapshot on x86_64)
On the following code:
#include <functional>
void test_1 (std::tuple<int>);
void test (int tst) {
const std::function<void()> fun (std::bind(&test_1, std::tuple<int>(tst)));
};
with the command line "g++-4.6 -std=c++0x -c bind_test.cc -o bind_tst.o", I get
the following error message:
In file included from bind_test.cc:2:0:
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional:
In static member function ‘static void std::_Function_handler<void(_ArgTypes
...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes ...) [with _Functor
= std::_Bind<void (*(std::tuple<int>))(std::tuple<int>)>, _ArgTypes = {}]’:
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional:2135:6:
instantiated from ‘std::function<_Res(_ArgTypes ...)>::function(_Functor,
typename std::enable_if<(! std::is_integral<_Functor>::value),
std::function<_Res(_ArgTypes ...)>::_Useless>::type) [with _Functor =
std::_Bind<void (*(std::tuple<int>))(std::tuple<int>)>, _Res = void, _ArgTypes
= {}, typename std::enable_if<(! std::is_integral<_Functor>::value),
std::function<_Res(_ArgTypes ...)>::_Useless>::type =
std::function<void()>::_Useless]’
bind_test.cc:6:76: instantiated from here
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional:1765:9:
error: no matching function for call to ‘std::tuple<int>::tuple(const volatile
std::tuple<int>&)’
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional:1765:9:
note: candidates are:
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:441:32:
note: template<class _U1> std::tuple<_T1>::tuple(std::tuple<_U1>&&)
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:437:37:
note: template<class _U1> std::tuple<_T1>::tuple(const std::tuple<_U1>&)
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:433:7:
note: std::tuple<_T1>::tuple(std::tuple<_T1>&&) [with _T1 = int,
std::tuple<_T1> = std::tuple<int>]
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:433:7:
note: no known conversion for argument 1 from ‘const volatile
std::tuple<int>’ to ‘std::tuple<int>&&’
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:431:17:
note: constexpr std::tuple<_T1>::tuple(const std::tuple<_T1>&) [with _T1 = int,
std::tuple<_T1> = std::tuple<int>]
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:431:17:
note: no known conversion for argument 1 from ‘const volatile
std::tuple<int>’ to ‘const std::tuple<int>&’
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:418:17:
note: constexpr std::tuple<_T1>::tuple() [with _T1 = int]
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:418:17:
note: candidate expects 0 arguments, 1 provided
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional:1765:9:
error: no matching function for call to ‘std::tuple<int>::tuple(volatile
std::tuple<int>&)’
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/functional:1765:9:
note: candidates are:
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:441:32:
note: template<class _U1> std::tuple<_T1>::tuple(std::tuple<_U1>&&)
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:437:37:
note: template<class _U1> std::tuple<_T1>::tuple(const std::tuple<_U1>&)
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:433:7:
note: std::tuple<_T1>::tuple(std::tuple<_T1>&&) [with _T1 = int,
std::tuple<_T1> = std::tuple<int>]
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:433:7:
note: no known conversion for argument 1 from ‘volatile std::tuple<int>’ to
‘std::tuple<int>&&’
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:431:17:
note: constexpr std::tuple<_T1>::tuple(const std::tuple<_T1>&) [with _T1 = int,
std::tuple<_T1> = std::tuple<int>]
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:431:17:
note: no known conversion for argument 1 from ‘volatile std::tuple<int>’ to
‘const std::tuple<int>&’
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:418:17:
note: constexpr std::tuple<_T1>::tuple() [with _T1 = int]
/usr/lib/gcc/x86_64-linux-gnu/4.6.0/../../../../include/c++/4.6.0/tuple:418:17:
note: candidate expects 0 arguments, 1 provided
Since I can't see anything illegal with the code, my guess is that it is a
problem with the C++0x headers (the compilation is fine with gcc 4.5.2 with
-std=c++0x argument).
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
@ 2011-03-14 14:09 ` redi at gcc dot gnu.org
2011-03-14 14:19 ` [Bug libstdc++/48113] [4.6 Regression] " redi at gcc dot gnu.org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-14 14:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.03.14 14:09:41
Ever Confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-14 14:09:41 UTC ---
harrumph, I thought we'd solved these problems with the volatile overloads,
apparently not. I'll look into it later
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
2011-03-14 14:09 ` [Bug libstdc++/48113] " redi at gcc dot gnu.org
@ 2011-03-14 14:19 ` redi at gcc dot gnu.org
2011-03-14 14:26 ` [Bug libstdc++/48113] [4.6/4.7 " rguenth at gcc dot gnu.org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-14 14:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.6/4.7 Regression] |[4.6 Regression] [C++0x]
|[C++0x] bind with tuple |bind with tuple argument
|argument fails |fails
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-14 14:19:36 UTC ---
N.B. as a workaround you can specify the return type of the bind expression:
std::bind<void>(&test_1, std::tuple<int>(tst))
^^^^^^
This avoids the problem code, which is trying to determine the return type.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
2011-03-14 14:09 ` [Bug libstdc++/48113] " redi at gcc dot gnu.org
2011-03-14 14:19 ` [Bug libstdc++/48113] [4.6 Regression] " redi at gcc dot gnu.org
@ 2011-03-14 14:26 ` rguenth at gcc dot gnu.org
2011-03-14 16:23 ` redi at gcc dot gnu.org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-14 14:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.0
Summary|[4.6 Regression] [C++0x] |[4.6/4.7 Regression]
|bind with tuple argument |[C++0x] bind with tuple
|fails |argument fails
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (2 preceding siblings ...)
2011-03-14 14:26 ` [Bug libstdc++/48113] [4.6/4.7 " rguenth at gcc dot gnu.org
@ 2011-03-14 16:23 ` redi at gcc dot gnu.org
2011-03-14 17:24 ` jason at gcc dot gnu.org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-14 16:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-14 16:22:44 UTC ---
Jason, could you take a look at this reduced testcase, which has no libstdc++
dependency?
template<typename T> T declval();
struct tuple { };
struct F1
{
void operator()(tuple);
};
typedef void (*F2)(tuple);
template<typename F, typename T>
struct Bind
{
decltype( F()(declval<T&>()) )
f();
decltype( F()(declval<volatile T&>()) )
f() volatile;
};
int main()
{
Bind<F1, tuple>().f(); // OK
Bind<F2, tuple>().f(); // ERROR
}
This shows that SFINAE removes the Bind::f() volatile overload if F is a
functor, but not if it's a function pointer. I can't see why it should be
different.
Is this a FE bug, or do I need to handle function pointers differently in
std::bind? Thanks
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (3 preceding siblings ...)
2011-03-14 16:23 ` redi at gcc dot gnu.org
@ 2011-03-14 17:24 ` jason at gcc dot gnu.org
2011-03-14 17:34 ` jason at gcc dot gnu.org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-14 17:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-14 17:24:36 UTC ---
SFINAE is not removing an overload; it doesn't work like that. SFINAE only
applies to function templates, not non-template member functions of class
templates. It's just that for some reason we aren't complaining about the
functor case. Reduced further:
struct A { };
volatile A& f();
struct F1
{
void operator()(A);
};
typedef void (*F2)(A);
typedef decltype (F1()(f())) t1;
typedef decltype (F2()(f())) t2;
The inconsistency is odd. I would expect both lines to give an error.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (4 preceding siblings ...)
2011-03-14 17:24 ` jason at gcc dot gnu.org
@ 2011-03-14 17:34 ` jason at gcc dot gnu.org
2011-03-14 17:56 ` paolo.carlini at oracle dot com
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-14 17:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
AssignedTo|jason at gcc dot gnu.org |unassigned at gcc dot
| |gnu.org
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-14 17:33:44 UTC ---
Indeed, EDG 4.2 rejects both. So the bug report is indeed a library issue.
I'll open a separate report for the accepts-invalid example.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (5 preceding siblings ...)
2011-03-14 17:34 ` jason at gcc dot gnu.org
@ 2011-03-14 17:56 ` paolo.carlini at oracle dot com
2011-03-14 18:02 ` redi at gcc dot gnu.org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-03-14 17:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-03-14 17:55:53 UTC ---
I suspect Jon reduced the testcase a bit too much, because we have been through
this kind of discussion/misunderstanding already, indeed normally we have only
function *templates* in the actual code, no SFINAE to the help otherwise,
agreed.
Thanks Jon (and Jason) for looking into this.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (6 preceding siblings ...)
2011-03-14 17:56 ` paolo.carlini at oracle dot com
@ 2011-03-14 18:02 ` redi at gcc dot gnu.org
2011-03-14 18:04 ` redi at gcc dot gnu.org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-14 18:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-14 18:01:51 UTC ---
Doh, yes I got carried away reducing it and made it no longer a template
function, so of course SFINAE doesn't apply - sorry!
Should it apply in the case below?
template<typename T> T declval();
struct tuple { };
struct F1
{
void operator()(tuple);
};
typedef void (*F2)(tuple);
template<typename F, typename T>
struct Bind
{
template<typename A, typename R = decltype( F()(declval<T&>()) )>
R f(A);
template<typename A, typename R = decltype( F()(declval<volatile T&>()) )>
R f(A) volatile;
};
int main()
{
Bind<F1, tuple>().f(0); // OK
Bind<F2, tuple>().f(0); // ERROR
}
Currently Bind::f() volatile gives an error during overload resolution but the
other overload doesn't. Will your fix make both fail?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (7 preceding siblings ...)
2011-03-14 18:02 ` redi at gcc dot gnu.org
@ 2011-03-14 18:04 ` redi at gcc dot gnu.org
2011-03-14 18:10 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-14 18:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-14 18:03:52 UTC ---
(In reply to comment #7)
> Currently Bind::f() volatile gives an error during overload resolution but the
> other overload doesn't. Will your fix make both fail?
brain really not firing today ... I meant:
Currently Bind::f() volatile gives an error for F2, but not F1. Will you fix
make both fail?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (8 preceding siblings ...)
2011-03-14 18:04 ` redi at gcc dot gnu.org
@ 2011-03-14 18:10 ` redi at gcc dot gnu.org
2011-03-14 18:48 ` [Bug c++/48113] " jason at gcc dot gnu.org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-14 18:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-14 18:10:19 UTC ---
here's one even closer to what we actually have in the library, where the
default template argument R involves the deduced type A as well:
template<typename T> T declval();
struct tuple { };
struct F1
{
void operator()(tuple, int);
};
typedef void (*F2)(tuple, int);
template<typename F, typename T>
struct Bind
{
template<typename A,
typename R = decltype( F()(declval<T&>(), A()) )>
R f(A);
template<typename A,
typename R = decltype( F()(declval<volatile T&>(), A()) )>
R f(A) volatile;
};
int main()
{
Bind<F1, tuple>().f(0); // OK
Bind<F2, tuple>().f(0); // ERROR
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (9 preceding siblings ...)
2011-03-14 18:10 ` redi at gcc dot gnu.org
@ 2011-03-14 18:48 ` jason at gcc dot gnu.org
2011-03-14 18:59 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-14 18:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Component|libstdc++ |c++
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-14 18:47:53 UTC ---
That is indeed a SFINAE bug.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (10 preceding siblings ...)
2011-03-14 18:48 ` [Bug c++/48113] " jason at gcc dot gnu.org
@ 2011-03-14 18:59 ` redi at gcc dot gnu.org
2011-03-16 20:03 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-14 18:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-14 18:59:45 UTC ---
(In reply to comment #10)
> That is indeed a SFINAE bug.
phew! cos I'm all out of better ideas for fixing std::bind ;)
Thanks for your help, sorry for the mixup with my overeager testcase reduction,
but at least we found a new bug out of it
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (11 preceding siblings ...)
2011-03-14 18:59 ` redi at gcc dot gnu.org
@ 2011-03-16 20:03 ` jason at gcc dot gnu.org
2011-03-16 20:04 ` jason at gcc dot gnu.org
2011-03-16 20:24 ` jason at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-16 20:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
--- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-16 20:03:07 UTC ---
Author: jason
Date: Wed Mar 16 20:03:01 2011
New Revision: 171064
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171064
Log:
PR c++/48113
* typeck.c (convert_for_initialization): Use
perform_implicit_conversion_flags.
* call.c (standard_conversion): If LOOKUP_PREFER_RVALUE, set
rvaluedness_matches_p on ck_rvalue.
(convert_like_real) [ck_rvalue]: And restore it here.
Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/sfinae6.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/call.c
branches/gcc-4_6-branch/gcc/cp/typeck.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/initlist38.C
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/pr45908.C
branches/gcc-4_6-branch/gcc/testsuite/g++.old-deja/g++.jason/conversion11.C
branches/gcc-4_6-branch/gcc/testsuite/g++.old-deja/g++.law/arg11.C
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (12 preceding siblings ...)
2011-03-16 20:03 ` jason at gcc dot gnu.org
@ 2011-03-16 20:04 ` jason at gcc dot gnu.org
2011-03-16 20:24 ` jason at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-16 20:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-16 20:04:01 UTC ---
Author: jason
Date: Wed Mar 16 20:03:56 2011
New Revision: 171067
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171067
Log:
PR c++/48113
* typeck.c (convert_for_initialization): Use
perform_implicit_conversion_flags.
* call.c (standard_conversion): If LOOKUP_PREFER_RVALUE, set
rvaluedness_matches_p on ck_rvalue.
(convert_like_real) [ck_rvalue]: And restore it here.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/initlist38.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr45908.C
trunk/gcc/testsuite/g++.old-deja/g++.jason/conversion11.C
trunk/gcc/testsuite/g++.old-deja/g++.law/arg11.C
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
` (13 preceding siblings ...)
2011-03-16 20:04 ` jason at gcc dot gnu.org
@ 2011-03-16 20:24 ` jason at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-16 20:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-16 20:22:57 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2011-03-16 20:23 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-14 14:02 [Bug libstdc++/48113] New: [C++0x] bind with tuple argument fails martin.kronbichler at it dot uu.se
2011-03-14 14:09 ` [Bug libstdc++/48113] " redi at gcc dot gnu.org
2011-03-14 14:19 ` [Bug libstdc++/48113] [4.6 Regression] " redi at gcc dot gnu.org
2011-03-14 14:26 ` [Bug libstdc++/48113] [4.6/4.7 " rguenth at gcc dot gnu.org
2011-03-14 16:23 ` redi at gcc dot gnu.org
2011-03-14 17:24 ` jason at gcc dot gnu.org
2011-03-14 17:34 ` jason at gcc dot gnu.org
2011-03-14 17:56 ` paolo.carlini at oracle dot com
2011-03-14 18:02 ` redi at gcc dot gnu.org
2011-03-14 18:04 ` redi at gcc dot gnu.org
2011-03-14 18:10 ` redi at gcc dot gnu.org
2011-03-14 18:48 ` [Bug c++/48113] " jason at gcc dot gnu.org
2011-03-14 18:59 ` redi at gcc dot gnu.org
2011-03-16 20:03 ` jason at gcc dot gnu.org
2011-03-16 20:04 ` jason at gcc dot gnu.org
2011-03-16 20:24 ` jason 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).