* pt.c (instantiate_decl): Fix pattern_defined for namespace scope
variable templates.
From-SVN: r238622
2016-07-21 Jason Merrill <jason@redhat.com>
+ PR c++/71630
+ * pt.c (instantiate_decl): Fix pattern_defined for namespace scope
+ variable templates.
+
PR c++/71913
* call.c (unsafe_copy_elision_p): It's OK to elide when
initializing an unknown object.
else
{
deleted_p = false;
- pattern_defined = ! DECL_IN_AGGR_P (code_pattern);
+ if (DECL_CLASS_SCOPE_P (code_pattern))
+ pattern_defined = ! DECL_IN_AGGR_P (code_pattern);
+ else
+ pattern_defined = ! DECL_EXTERNAL (code_pattern);
}
/* We may be in the middle of deferred access check. Disable it now. */
--- /dev/null
+// PR c++/71630
+// { dg-do compile { target c++14 } }
+
+template <class T>
+extern T pi;
+
+int main()
+{
+ return pi<int>;
+}