PR c++/37006
* pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
instantiations.
From-SVN: r138648
+2008-08-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/37006
+ * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
+ instantiations.
+
2008-08-04 Simon Baldwin <simonb@google.com>
PR c++/36999
/* Clear out the mangled name and RTL for the instantiation. */
SET_DECL_ASSEMBLER_NAME (r, NULL_TREE);
SET_DECL_RTL (r, NULL_RTX);
- DECL_INITIAL (r) = NULL_TREE;
+ /* Leave DECL_INITIAL set on deleted instantiations. */
+ if (!DECL_DELETED_FN (r))
+ DECL_INITIAL (r) = NULL_TREE;
DECL_CONTEXT (r) = ctx;
if (member && DECL_CONV_FN_P (r))
--- /dev/null
+// PR c++/37006
+// { dg-options "-std=c++0x" }
+
+template<class T>
+struct A {
+ template<class U>
+ bool operator==(const A<U>&) = delete; // { dg-error "deleted function" }
+ operator bool () { return true; }
+};
+
+int main()
+{
+ A<int> a1;
+ A<void> a2;
+ if(a1 == a2) {} // { dg-error "used here" }
+}