PR c++/71630 - extern variable template
* pt.c (instantiate_decl): Fix pattern_defined for namespace scope variable templates. From-SVN: r238622
This commit is contained in:
parent
a93f3513c2
commit
44ed47547a
@ -1,5 +1,9 @@
|
||||
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.
|
||||
|
@ -21853,7 +21853,10 @@ instantiate_decl (tree d, int defer_ok,
|
||||
else
|
||||
{
|
||||
deleted_p = false;
|
||||
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. */
|
||||
|
10
gcc/testsuite/g++.dg/cpp1y/var-templ53.C
Normal file
10
gcc/testsuite/g++.dg/cpp1y/var-templ53.C
Normal file
@ -0,0 +1,10 @@
|
||||
// PR c++/71630
|
||||
// { dg-do compile { target c++14 } }
|
||||
|
||||
template <class T>
|
||||
extern T pi;
|
||||
|
||||
int main()
|
||||
{
|
||||
return pi<int>;
|
||||
}
|
Loading…
Reference in New Issue
Block a user