]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/19149 (seg fault on invalid code)
authorMark Mitchell <mark@codesourcery.com>
Mon, 27 Dec 2004 19:03:16 +0000 (19:03 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 27 Dec 2004 19:03:16 +0000 (19:03 +0000)
PR c++/19149
* decl.c (check_tag_decl): Robustify.

PR c++/19149
* g++.dg/parse/error23.C: New test.

From-SVN: r92648

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/error23.C [new file with mode: 0644]

index cf9a42c9f8a8254bdf11a43708f390eb5e675d53..a62a61e565c67a4ef095c1d323edf4f0df6b507e 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-27  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/19149
+       * decl.c (check_tag_decl): Robustify.
+
 2004-12-23  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/17595
index be1adddb862237cd941e2385726d1d78e1be823c..991996bc3f56f8d3b5c9ffa242b1df7ed337c591 100644 (file)
@@ -3514,7 +3514,8 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
       return NULL_TREE;
     }
 
-  if (TYPE_P (declspecs->type)
+  if (declspecs->type
+      && TYPE_P (declspecs->type)
       && ((TREE_CODE (declspecs->type) != TYPENAME_TYPE
           && IS_AGGR_TYPE (declspecs->type))
          || TREE_CODE (declspecs->type) == ENUMERAL_TYPE))
index ff084064e7fa40f9f7bd5407f2c600b3d0a4f13d..1b81b8384d385e851407b6d0d3eaee84434bb5cf 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-27  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/19149
+       * g++.dg/parse/error23.C: New test.
+
 2004-12-27  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
 
        * gfortran.dg/g77/f90-intrinsic-bit.f: New.
diff --git a/gcc/testsuite/g++.dg/parse/error23.C b/gcc/testsuite/g++.dg/parse/error23.C
new file mode 100644 (file)
index 0000000..7d6fda2
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/19149
+
+struct QChar {
+  QChar( char c );
+  QChar( const QChar& c );
+  static const ; // { dg-error "" }
+};