aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2001-07-26 12:48:01 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2001-07-26 12:48:01 +0000
commitdb3ef87b8a1858f77998a9e8a5275cc5755350d7 (patch)
tree0f0dee1191602d0d5c890d49e73f62752caff763
parentfa397ddafb335eb0a67b08e014605bf5f9ab7cc5 (diff)
downloadgcc-db3ef87b8a1858f77998a9e8a5275cc5755350d7.zip
gcc-db3ef87b8a1858f77998a9e8a5275cc5755350d7.tar.gz
gcc-db3ef87b8a1858f77998a9e8a5275cc5755350d7.tar.bz2
pt.c (tsubst_template_parms): Call maybe_fold_nontype_arg and tsubst_expr for default template arguments.
2001-07-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> * pt.c (tsubst_template_parms): Call maybe_fold_nontype_arg and tsubst_expr for default template arguments. 2001-07-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> * g++.old-deja/g++.pt/defarg14.C: New test. From-SVN: r44396
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/defarg14.C18
4 files changed, 30 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index dd1be64..7569249 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-26 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * pt.c (tsubst_template_parms): Call maybe_fold_nontype_arg and
+ tsubst_expr for default template arguments.
+
2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
* spew.c (yylex): Only copy the token's lineno, if it is
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d09ce8f..1f40089 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5377,8 +5377,9 @@ tsubst_template_parms (parms, args, complain)
TREE_VALUE (TREE_VEC_ELT (TREE_VALUE (parms), i));
TREE_VEC_ELT (new_vec, i)
- = build_tree_list (tsubst (default_value, args, complain,
- NULL_TREE),
+ = build_tree_list (maybe_fold_nontype_arg (
+ tsubst_expr (default_value, args, complain,
+ NULL_TREE)),
tsubst (parm_decl, args, complain,
NULL_TREE));
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f2354d4..5b9ab08 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2001-07-26 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * g++.old-deja/g++.pt/defarg14.C: New test.
+
2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/lineno5.C: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/defarg14.C b/gcc/testsuite/g++.old-deja/g++.pt/defarg14.C
new file mode 100644
index 0000000..7ae4941
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/defarg14.C
@@ -0,0 +1,18 @@
+// Build don't link:
+
+// Origin: Larry Evans <jcampbell3@prodigy.net>
+
+// Bug: enum in default template arguments are not properly handled.
+
+enum Enum0 { E0, E1, E2 };
+enum Enum1 { E3=E2+1, E4=E3+1 };
+
+template <Enum0 Out_FARG0> class OutTmpl
+{
+ public:
+ template <Enum0 In_FARG0, Enum1 In_FARG1=E4> class InTmpl
+ {
+ };
+};
+
+OutTmpl<E1> m;