aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-10-28 21:37:21 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-10-28 21:37:21 +0000
commit930cd7963b4a8e30901950a1103c7a84257ee8db (patch)
treef9b766c10d56911ec3d339018173bc602fa170fb /gcc/cp/pt.c
parentcea1f697a4487ba7b801c7bdb3f15379953fa34e (diff)
downloadgcc-930cd7963b4a8e30901950a1103c7a84257ee8db.zip
gcc-930cd7963b4a8e30901950a1103c7a84257ee8db.tar.gz
gcc-930cd7963b4a8e30901950a1103c7a84257ee8db.tar.bz2
pt.c (instantiate_decl): Always instantiate static data members initialized in-class.
* pt.c (instantiate_decl): Always instantiate static data members initialized in-class. From-SVN: r37107
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f7e27ce..8ca2468 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9614,12 +9614,6 @@ instantiate_decl (d, defer_ok)
import_export_decl (d);
}
- /* Reject all external templates except inline functions. */
- if (DECL_INTERFACE_KNOWN (d)
- && ! DECL_NOT_REALLY_EXTERN (d)
- && ! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d)))
- goto out;
-
/* We need to set up DECL_INITIAL regardless of pattern_defined if
the variable is a static const initialized in the class body. */
if (TREE_CODE (d) == VAR_DECL
@@ -9627,6 +9621,11 @@ instantiate_decl (d, defer_ok)
&& DECL_INITIAL (d) == NULL_TREE
&& DECL_INITIAL (code_pattern) != NULL_TREE)
;
+ /* Reject all external templates except inline functions. */
+ else if (DECL_INTERFACE_KNOWN (d)
+ && ! DECL_NOT_REALLY_EXTERN (d)
+ && ! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d)))
+ goto out;
/* Defer all other templates, unless we have been explicitly
forbidden from doing so. We restore the source position here
because it's used by add_pending_template. */