parser.c (cp_parser_dependent_type_p): Fix thinko.
authorMark Mitchell <mark@codesourcery.com>
Tue, 31 Dec 2002 20:28:27 +0000 (20:28 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 31 Dec 2002 20:28:27 +0000 (20:28 +0000)
* parser.c (cp_parser_dependent_type_p): Fix thinko.

* g++.dg/init/array9.C: New test.

From-SVN: r60718

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/g++.dg/template/crash3.C [new file with mode: 0644]

index 987e42bac40e83ac2135521301d045c2a8d9e2d1..6aca0297f5f637689433513be4e7adb381f5a880 100644 (file)
@@ -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.
index a4953c888cbba26db01923097b24508571b424a2..57dae655f39e518dd64d33de38bf2d173f9b03de 100644 (file)
@@ -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 (file)
index 0000000..21aa57b
--- /dev/null
@@ -0,0 +1,12 @@
+struct S {
+};
+
+extern S i[];
+
+void g (S*);
+
+template <typename T>
+void f () {
+  g (&i[2]);
+}
+