diff options
author | kan <kan@FreeBSD.org> | 2007-08-14 02:45:23 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2007-08-14 02:45:23 +0000 |
commit | d2ff90cc580c62afb8528917c1c80ac49d9aaa01 (patch) | |
tree | 7b2fa7d3de8706d9ca72fdb284ce2a57f67d460a /contrib/gcc/cp/parser.c | |
parent | 8a2681fa7ee14c49235e12318f7de5a9a7f492ea (diff) | |
download | FreeBSD-src-d2ff90cc580c62afb8528917c1c80ac49d9aaa01.zip FreeBSD-src-d2ff90cc580c62afb8528917c1c80ac49d9aaa01.tar.gz |
GCC 4.2.1 release.
Diffstat (limited to 'contrib/gcc/cp/parser.c')
-rw-r--r-- | contrib/gcc/cp/parser.c | 14 |
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 |