aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-12-31 20:28:27 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-12-31 20:28:27 +0000
commitf1aba0a5663a6c2749aeb0cac3449e2b736b835f (patch)
treede11de8bbb7454f6f4599d9ad68cd5ceb0faa7ee
parent89a7012acaa41c5086fee62356fa0b9cf84f0dc1 (diff)
downloadgcc-f1aba0a5663a6c2749aeb0cac3449e2b736b835f.zip
gcc-f1aba0a5663a6c2749aeb0cac3449e2b736b835f.tar.gz
gcc-f1aba0a5663a6c2749aeb0cac3449e2b736b835f.tar.bz2
parser.c (cp_parser_dependent_type_p): Fix thinko.
* parser.c (cp_parser_dependent_type_p): Fix thinko. * g++.dg/init/array9.C: New test. From-SVN: r60718
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/testsuite/g++.dg/template/crash3.C12
3 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 987e42b..6aca029 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2002-12-31 Mark Mitchell <mark@codesourcery.com>
+
+ * parser.c (cp_parser_dependent_type_p): Fix thinko.
+
2002-12-31 Nathan Sidwell <nathan@codesourcery.com>
* class.c (modify_vtable_entry): Remove unused variable.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index a4953c8..57dae65 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -1882,7 +1882,7 @@ cp_parser_dependent_type_p (type)
value-dependent. */
if (TREE_CODE (type) == ARRAY_TYPE)
{
- if (TYPE_DOMAIN (TREE_TYPE (type))
+ if (TYPE_DOMAIN (type)
&& ((cp_parser_value_dependent_expression_p
(TYPE_MAX_VALUE (TYPE_DOMAIN (type))))
|| (cp_parser_type_dependent_expression_p
diff --git a/gcc/testsuite/g++.dg/template/crash3.C b/gcc/testsuite/g++.dg/template/crash3.C
new file mode 100644
index 0000000..21aa57b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash3.C
@@ -0,0 +1,12 @@
+struct S {
+};
+
+extern S i[];
+
+void g (S*);
+
+template <typename T>
+void f () {
+ g (&i[2]);
+}
+