PR c++/49058
* call.c (splice_viable): Be strict in templates.
From-SVN: r174073
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.
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.
--- /dev/null
+// 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;
+}