]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/28878 (ICE using "[" instead of "{")
authorJakub Jelinek <jakub@redhat.com>
Sat, 2 Sep 2006 06:54:04 +0000 (08:54 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 2 Sep 2006 06:54:04 +0000 (08:54 +0200)
PR c++/28878
* except.c (build_throw): Only set current_function_returns_abnormally
if cfun is not NULL.

* g++.dg/parse/crash33.C: New test.

From-SVN: r116655

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

index 5f37ddecd4b83a7dd02991bad12d208c139ece50..4709c147aeb04e5da7519efe5be0e23847240d1c 100644 (file)
@@ -1,5 +1,9 @@
 2006-09-02  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/28878
+       * except.c (build_throw): Only set current_function_returns_abnormally
+       if cfun is not NULL.
+
        PR c++/26917
        * repo.c (repo_file): Remove.
        (open_repo_file, reopen_repo_file_for_write): Return fopened
index ad493aa389ca782971319e2e8f2e1066c16c1091..f97ab063dde5f383f09ef990d84acb0eed8e592c 100644 (file)
@@ -605,7 +605,8 @@ build_throw (tree exp)
 
   if (processing_template_decl)
     {
-      current_function_returns_abnormally = 1;
+      if (cfun)
+       current_function_returns_abnormally = 1;
       return build_min (THROW_EXPR, void_type_node, exp);
     }
 
index e4210b84567d2fa1f74746da7817f207821fdb47..a8c9b6200a676a1fc2be5269ad3323e47f757f63 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/28878
+       * g++.dg/parse/crash33.C: New test.
+
 2006-09-01  J"orn Rennecke  <joern.rennecke@st.com>
        Richard Guenther  <rguenther@suse.de>
        Adam Nemet  <anemet@caviumnetworks.com>
diff --git a/gcc/testsuite/g++.dg/parse/crash33.C b/gcc/testsuite/g++.dg/parse/crash33.C
new file mode 100644 (file)
index 0000000..2ab84df
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/28878
+// { dg-do compile }
+
+template<int>
+void foo()
+[
+  throw;       // { dg-error "expected" }
+}              // { dg-error "expected" }