2013-03-16 Jason Merrill <jason@redhat.com>
+ DR 337
+ PR c++/17232
+ * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
+ * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
+
DR 657
* pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
(tsubst_arg_types): Likewise.
error ("creating array of %qT", type);
return error_mark_node;
}
- if (ABSTRACT_CLASS_TYPE_P (type))
- {
- if (complain & tf_error)
- error ("creating array of %qT, which is an abstract class type",
- type);
- return error_mark_node;
- }
+
+ if (abstract_virtuals_error_sfinae (NULL_TREE, type, complain))
+ return error_mark_node;
r = build_cplus_array_type (type, domain);
return 0;
type = TYPE_MAIN_VARIANT (type);
+ /* In SFINAE context, force instantiation. */
+ if (!(complain & tf_error))
+ complete_type (type);
+
/* If the type is incomplete, we register it within a hash table,
so that we can check again once it is completed. This makes sense
only for objects for which we have a declaration or at least a
--- /dev/null
+// PR c++/17232 (DR 337)
+
+template<typename T>
+class A {
+ virtual void f() = 0;
+};
+
+template<typename T>
+void g(T (*a)[1]) {} // { dg-error "abstract" }
+
+int main() {
+ g<A<int> >(0); // { dg-error "no matching function" }
+}