PR c++/52759
* decl.c (start_decl): Don't call maybe_apply_pragma_weak
if processing_template_decl.
* g++.dg/ext/weak4.C: New test.
From-SVN: r185966
+2012-03-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/52759
+ * decl.c (start_decl): Don't call maybe_apply_pragma_weak
+ if processing_template_decl.
+
2012-03-29 Jason Merrill <jason@redhat.com>
PR c++/52743
}
/* If #pragma weak was used, mark the decl weak now. */
- maybe_apply_pragma_weak (decl);
+ if (!processing_template_decl)
+ maybe_apply_pragma_weak (decl);
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_DECLARED_INLINE_P (decl)
2012-03-29 Jakub Jelinek <jakub@redhat.com>
+ PR c++/52759
+ * g++.dg/ext/weak4.C: New test.
+
PR tree-optimization/52760
* gcc.c-torture/execute/pr52760.c: New test.
--- /dev/null
+// PR c++/52759
+// { dg-do compile }
+// { dg-require-weak "" }
+// { dg-options "" }
+#pragma weak foo
+template <typename T>
+struct A { };
+template <typename T>
+void bar (A<T> &);