===================================================================
@@ -12407,8 +12407,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t com
if (DECL_CONSTRUCTOR_P (r) || DECL_DESTRUCTOR_P (r))
{
maybe_retrofit_in_chrg (r);
- if (DECL_CONSTRUCTOR_P (r))
- grok_ctor_properties (ctx, r);
+ if (DECL_CONSTRUCTOR_P (r) && !grok_ctor_properties (ctx, r))
+ RETURN (error_mark_node);
/* If this is an instantiation of a member template, clone it.
If it isn't, that'll be handled by
clone_constructors_and_destructors. */
===================================================================
@@ -0,0 +1,13 @@
+// PR c++/80186
+
+template < class T, class > struct A
+{
+ A ();
+ A (A &);
+ A (A < T, T >); // { dg-error "invalid constructor" }
+};
+
+void f ()
+{
+ A < int, int > (A < int, int >()); // { dg-error "cannot bind" }
+}