* pt.c (instantiate_decl): Fix call to variable_template_p.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234231
138bc75d-0d04-0410-961f-
82ee72b054a4
2016-03-15 Jason Merrill <jason@redhat.com>
+ PR c++/70095
+ * pt.c (instantiate_decl): Fix call to variable_template_p.
+
PR c++/70141
* pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
if (enter_context)
pop_nested_class ();
- if (variable_template_p (td))
+ if (variable_template_p (gen_tmpl))
note_variable_template_instantiation (d);
}
else if (TREE_CODE (d) == FUNCTION_DECL && DECL_DEFAULTED_FN (code_pattern))
--- /dev/null
+// PR c++/70095
+// { dg-do link { target c++14 } }
+
+template <typename T> struct Foo;
+template <typename T> int variable_template = 0;
+template <typename T> int variable_template<Foo<T>> = 0;
+template <typename T> int get_variable_template() { return variable_template<T>; }
+
+int main() {
+ get_variable_template<Foo<int>>();
+}