diff options
author | Jason Merrill <jason@redhat.com> | 2016-07-21 23:45:43 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-07-21 23:45:43 -0400 |
commit | 44ed47547a1cb981faa264b9c29bd52c2f2891af (patch) | |
tree | f779b1f3cb43ec94e1d6c785bb2e547a8f9a246c /gcc/cp | |
parent | a93f3513c2c1fef4541306f24597f1fc154548b3 (diff) | |
download | gcc-44ed47547a1cb981faa264b9c29bd52c2f2891af.zip gcc-44ed47547a1cb981faa264b9c29bd52c2f2891af.tar.gz gcc-44ed47547a1cb981faa264b9c29bd52c2f2891af.tar.bz2 |
PR c++/71630 - extern variable template
* pt.c (instantiate_decl): Fix pattern_defined for namespace scope
variable templates.
From-SVN: r238622
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b196d54..8cf538b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d7f3808..5e29d99 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -21853,7 +21853,10 @@ instantiate_decl (tree d, int defer_ok, 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. */ |