Commit 44ed4754 by Jason Merrill Committed by Jason Merrill

PR c++/71630 - extern variable template

	* pt.c (instantiate_decl): Fix pattern_defined for namespace scope
	variable templates.

From-SVN: r238622
parent a93f3513
2016-07-21 Jason Merrill <jason@redhat.com> 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 PR c++/71913
* call.c (unsafe_copy_elision_p): It's OK to elide when * call.c (unsafe_copy_elision_p): It's OK to elide when
initializing an unknown object. initializing an unknown object.
......
...@@ -21853,7 +21853,10 @@ instantiate_decl (tree d, int defer_ok, ...@@ -21853,7 +21853,10 @@ instantiate_decl (tree d, int defer_ok,
else else
{ {
deleted_p = false; 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. */ /* We may be in the middle of deferred access check. Disable it now. */
......
// PR c++/71630
// { dg-do compile { target c++14 } }
template <class T>
extern T pi;
int main()
{
return pi<int>;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment