2011-06-16 Jason Merrill <jason@redhat.com>
+ PR c++/49229
+ * pt.c (tsubst_decl) [FUNCTION_DECL]: Handle substitution failure.
+
PR c++/49251
* semantics.c (finish_id_expression): Mark even dependent
variables as used.
(DECL_TEMPLATE_RESULT
(DECL_TI_TEMPLATE (t))),
args, complain, in_decl);
+ if (argvec == error_mark_node)
+ RETURN (error_mark_node);
/* Check to see if we already have this specialization. */
hash = hash_tmpl_and_args (gen_tmpl, argvec);
2011-06-16 Jason Merrill <jason@redhat.com>
+ PR c++/49229
+ * g++.dg/cpp0x/sfinae26.C: New.
+
PR c++/49251
* g++.dg/cpp0x/variadic113.C: New.
--- /dev/null
+// PR c++/49229
+// { dg-options -std=c++0x }
+
+extern void* enabler;
+
+template<bool, class = void>
+struct enable_if {};
+
+template<class T>
+struct enable_if<true, T> {
+ typedef T type;
+};
+
+template<class... Bn>
+struct and_;
+
+template<class B1>
+struct and_<B1> : B1 {};
+
+template<class, class>
+struct is_same {
+ static constexpr bool value = false;
+};
+
+template<class T>
+struct is_same<T, T> {
+ static constexpr bool value = true;
+};
+
+template<class... T>
+struct S {
+ template<class... U,
+ typename enable_if<and_<is_same<T, U>...>::value>::type*& = enabler
+ >
+ S(U...){} // #
+};
+
+S<bool> s(0); // { dg-error "no match" }