* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166974
138bc75d-0d04-0410-961f-
82ee72b054a4
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.
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);
2010-11-20 Jakub Jelinek <jakub@redhat.com>
+ PR c++/46538
+ * g++.dg/other/error34.C: New test.
+
PR c++/46526
* g++.dg/cpp0x/constexpr-base3.C: New test.
--- /dev/null
+// PR c++/46538
+// { dg-do compile }
+// { dg-options "" }
+
+S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" }
+// { dg-error "only constructors" "" { target *-*-* } 5 }