PR c++/64898
* mangle.c (write_mangled_name): Fix test for variable template
instantiation.
From-SVN: r220666
2015-02-12 Jason Merrill <jason@redhat.com>
+ PR c++/64898
+ * mangle.c (write_mangled_name): Fix test for variable template
+ instantiation.
+
* decl.c (begin_destructor_body): Condition clobber on
-flifetime-dse.
}
else if (VAR_P (decl)
/* Variable template instantiations are mangled. */
- && !(DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl))
+ && !(DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
+ && variable_template_p (DECL_TI_TEMPLATE (decl)))
/* The names of non-static global variables aren't mangled. */
&& DECL_EXTERNAL_LINKAGE_P (decl)
&& (CP_DECL_CONTEXT (decl) == global_namespace
--- /dev/null
+// PR c++/64898
+// { dg-final { scan-assembler-not "_Z6foovar" } }
+
+template <class> void f()
+{
+ extern int foovar;
+ foovar = 42;
+}
+
+int main()
+{
+ f<int>();
+}