Commit 971df06b by Jason Merrill Committed by Jason Merrill

re PR c++/50114 (ICE with declaration inside for statement)

	PR c++/50114
	* decl.c (poplevel): Disable for scope compatibility hack
	in C++11 mode.

From-SVN: r178338
parent c683a53a
2011-08-30 Jason Merrill <jason@redhat.com> 2011-08-30 Jason Merrill <jason@redhat.com>
PR c++/50114
* decl.c (poplevel): Disable for scope compatibility hack
in C++11 mode.
PR c++/50220 PR c++/50220
* semantics.c (add_capture): Call complete_type for copy. * semantics.c (add_capture): Call complete_type for copy.
......
...@@ -643,6 +643,9 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -643,6 +643,9 @@ poplevel (int keep, int reverse, int functionbody)
for (link = decls; link; link = TREE_CHAIN (link)) for (link = decls; link; link = TREE_CHAIN (link))
{ {
if (leaving_for_scope && TREE_CODE (link) == VAR_DECL if (leaving_for_scope && TREE_CODE (link) == VAR_DECL
/* It's hard to make this ARM compatibility hack play nicely with
lambdas, and it really isn't necessary in C++11 mode. */
&& cxx_dialect < cxx0x
&& DECL_NAME (link)) && DECL_NAME (link))
{ {
tree name = DECL_NAME (link); tree name = DECL_NAME (link);
......
2011-08-30 Jason Merrill <jason@redhat.com>
PR c++/50114
* g++.dg/cpp0x/lambda/lambda-for.C: New.
2011-08-30 Uros Bizjak <ubizjak@gmail.com> 2011-08-30 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/fma-compile.c: Escape [ and ] in scan strings. * gcc.target/i386/fma-compile.c: Escape [ and ] in scan strings.
......
// PR c++/50114
// { dg-options "-std=c++0x -w" }
int open()
{
int *x2feed_i = 0;
auto insert_feed = [&](unsigned char venue, int* newfeed)
{
for(int x2feed_i = 1; 0; ) ;
x2feed_i = newfeed;
};
}
// { dg-do compile } // { dg-do compile }
// { dg-options -fpermissive } // { dg-options "-fpermissive -std=c++98" }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 Sept 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 Sept 2001 <nathan@codesourcery.com>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment