diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-11-20 09:15:33 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-11-20 09:15:33 +0100 |
commit | 8304847453e7d901839ae9f266394d57a86b6da4 (patch) | |
tree | aa96ab0b559b72a977730405dc1939c0b2371fe2 /gcc/cp | |
parent | d87d74e65be121c0a485ffa75fa2d97612a00b32 (diff) | |
download | gcc-8304847453e7d901839ae9f266394d57a86b6da4.zip gcc-8304847453e7d901839ae9f266394d57a86b6da4.tar.gz gcc-8304847453e7d901839ae9f266394d57a86b6da4.tar.bz2 |
re PR c++/46538 (ICE: SIGSEGV in cp_make_fname_decl (decl.c:3690) on invalid code when using __PRETTY_FUNCTION__)
PR c++/46538
* decl.c (cp_make_fname_decl): Return error_mark_node if
current_binding_level has already sk_function_parms kind.
* g++.dg/other/error34.C: New test.
From-SVN: r166974
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e3d97d2..8310ca6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2010-11-20 Jakub Jelinek <jakub@redhat.com> + PR c++/46538 + * decl.c (cp_make_fname_decl): Return error_mark_node if + current_binding_level has already sk_function_parms kind. + PR c++/46526 * semantics.c (cxx_eval_call_expression): Unshare the result. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 55e0d6a..787608c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3687,6 +3687,8 @@ cp_make_fname_decl (location_t loc, tree id, int type_dep) if (current_function_decl) { struct cp_binding_level *b = current_binding_level; + if (b->kind == sk_function_parms) + return error_mark_node; while (b->level_chain->kind != sk_function_parms) b = b->level_chain; pushdecl_with_scope (decl, b, /*is_friend=*/false); |