Commit 4d7f99c7 by Jason Merrill Committed by Jason Merrill

re PR libstdc++/49058 ([C++0x] Bind no-arguments functor failed using std::bind…

re PR libstdc++/49058 ([C++0x] Bind no-arguments functor failed using std::bind with -pedantic option.)

	PR c++/49058
	* call.c (splice_viable): Be strict in templates.

From-SVN: r174073
parent 42d1e31d
2011-05-23 Jason Merrill <jason@redhat.com>
PR c++/49058
* call.c (splice_viable): Be strict in templates.
PR c++/47336
* error.c (dump_template_bindings): Suppress access control.
......
......@@ -3009,6 +3009,11 @@ splice_viable (struct z_candidate *cands,
struct z_candidate **last_viable;
struct z_candidate **cand;
/* Be strict inside templates, since build_over_call won't actually
do the conversions to get pedwarns. */
if (processing_template_decl)
strict_p = true;
viable = NULL;
last_viable = &viable;
*any_viable_p = false;
......
2011-05-23 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/sfinae24.C: New.
* g++.dg/cpp0x/error3.C: New.
* g++.dg/cpp0x/defaulted27.C: New.
......
// PR c++/49058
// This error is not subject to SFINAE because it doesn't happen in the
// deduction context.
// { dg-options -std=c++0x }
// { dg-prune-output "note" }
template<typename T> T val();
struct F1
{
void operator()();
};
template<typename F>
struct Bind
{
template<typename R
= decltype( val<F>()( ) )>
R f();
template<typename R
= decltype( val<const F>()( ) )>
R f() const; // { dg-error "no match" }
};
int main()
{
Bind<F1> b;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment