aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGiovanni Bajo <giovannibajo@libero.it>2003-06-30 20:45:25 +0200
committerWolfgang Bangerth <bangerth@gcc.gnu.org>2003-06-30 12:45:25 -0600
commit9b61cc1bccb144e5483c6463348ef13915fbe829 (patch)
treeef49bf87bc4c50af9235c06a953bfa986601849c /gcc
parentfbfcbadc8f87d333559bf1bd2c3d690f7dda85c6 (diff)
downloadgcc-9b61cc1bccb144e5483c6463348ef13915fbe829.zip
gcc-9b61cc1bccb144e5483c6463348ef13915fbe829.tar.gz
gcc-9b61cc1bccb144e5483c6463348ef13915fbe829.tar.bz2
re PR c++/10750 (error with using template template expression in static const initializer)
2003-06-30 Giovanni Bajo <giovannibajo@libero.it> PR c++/10750 * parser.c (cp_parser_primary_expression): A VAR_DECL with a (value- or type-) dependent expression as DECL_INITIAL is a valid constant-expression (at parser time). From-SVN: r68720
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parser.c9
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9d84c82..821c85f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2003-06-30 Giovanni Bajo <giovannibajo@libero.it>
+
+ PR c++/10750
+ * parser.c (cp_parser_primary_expression): A VAR_DECL with a
+ (value- or type-) dependent expression as DECL_INITIAL is a
+ valid constant-expression (at parser time).
+
2003-06-30 Giovanni Bajo <giovannibajo@libero.it>
PR c++/11106
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 2116619..4635115 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -2783,11 +2783,16 @@ cp_parser_primary_expression (cp_parser *parser,
&& INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)))
/* Const variables or static data members of integral
or enumeration types initialized with constant
- expressions. */
+ expressions (or dependent expressions - in this case
+ the check will be done at instantiation time). */
&& !(TREE_CODE (decl) == VAR_DECL
&& INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl))
&& DECL_INITIAL (decl)
- && TREE_CONSTANT (DECL_INITIAL (decl))))
+ && (TREE_CONSTANT (DECL_INITIAL (decl))
+ || type_dependent_expression_p
+ (DECL_INITIAL (decl))
+ || value_dependent_expression_p
+ (DECL_INITIAL (decl)))))
{
if (!parser->allow_non_constant_expression_p)
return cp_parser_non_constant_id_expression (decl);