summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/cp/parser.c')
-rw-r--r--contrib/gcc/cp/parser.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/gcc/cp/parser.c b/contrib/gcc/cp/parser.c
index 62097ab..e060d49 100644
--- a/contrib/gcc/cp/parser.c
+++ b/contrib/gcc/cp/parser.c
@@ -3197,7 +3197,19 @@ cp_parser_primary_expression (cp_parser *parser,
/* If name lookup gives us a SCOPE_REF, then the
qualifying scope was dependent. */
if (TREE_CODE (decl) == SCOPE_REF)
- return decl;
+ {
+ /* At this point, we do not know if DECL is a valid
+ integral constant expression. We assume that it is
+ in fact such an expression, so that code like:
+
+ template <int N> struct A {
+ int a[B<N>::i];
+ };
+
+ is accepted. At template-instantiation time, we
+ will check that B<N>::i is actually a constant. */
+ return decl;
+ }
/* Check to see if DECL is a local variable in a context
where that is forbidden. */
if (parser->local_variables_forbidden_p
OpenPOWER on IntegriCloud