aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-01-25 05:53:12 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-01-25 00:53:12 -0500
commit7610f2ce1bff1c54feeb451f0b40dcc3d3350389 (patch)
treeaaffed3fd1d404bedd192dc2f7f42e8be8990999
parent6d4e202ef0717cf48bf209eddf628f942d444608 (diff)
downloadgcc-7610f2ce1bff1c54feeb451f0b40dcc3d3350389.zip
gcc-7610f2ce1bff1c54feeb451f0b40dcc3d3350389.tar.gz
gcc-7610f2ce1bff1c54feeb451f0b40dcc3d3350389.tar.bz2
pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a template.
* pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a template. * decl2.c (mark_used): Do instantiate inlines that have been explicitly instantiated. From-SVN: r31601
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/decl2.c3
-rw-r--r--gcc/cp/pt.c5
3 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 92dcb79..14cad83 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2000-01-24 Jason Merrill <jason@casey.cygnus.com>
+
+ * pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a
+ template.
+
+ * decl2.c (mark_used): Do instantiate inlines that have been
+ explicitly instantiated.
+
2000-01-24 Richard Henderson <rth@cygnus.com>
* call.c (build_over_call): Use expand_tree_builtin.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 51f02ec..56283c8 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -5202,7 +5202,8 @@ mark_used (decl)
instantiation because that is not checked in instantiate_decl. */
if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
&& DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
- && !DECL_EXPLICIT_INSTANTIATION (decl))
+ && (!DECL_EXPLICIT_INSTANTIATION (decl)
+ || (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))))
instantiate_decl (decl);
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 67670fa..701ec9b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5121,6 +5121,11 @@ static tree
maybe_fold_nontype_arg (arg)
tree arg;
{
+ /* If we're not in a template, ARG is already as simple as it's going to
+ get, and trying to reprocess the trees will break. */
+ if (! processing_template_decl)
+ return arg;
+
if (TREE_CODE_CLASS (TREE_CODE (arg)) != 't'
&& !uses_template_parms (arg))
{