re PR c++/28878 (ICE using "[" instead of "{")

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
This commit is contained in:
Jakub Jelinek 2006-09-02 08:54:04 +02:00 committed by Jakub Jelinek
parent b2a06efa61
commit 07515729e9
4 changed files with 19 additions and 1 deletions

View 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

View 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);
}

View 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>

View File

@ -0,0 +1,8 @@
// PR c++/28878
// { dg-do compile }
template<int>
void foo()
[
throw; // { dg-error "expected" }
} // { dg-error "expected" }