Comments
Patch
commit 03b745415d2109312c4449479c2f94e65bd770b4
Author: Jason Merrill <jason@redhat.com>
Date: Tue Aug 30 14:32:54 2011 -0400
PR c++/50114
* decl.c (poplevel): Disable for scope compatibility hack
in C++11 mode.
@@ -643,6 +643,9 @@ poplevel (int keep, int reverse, int functionbody)
for (link = decls; link; link = TREE_CHAIN (link))
{
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))
{
tree name = DECL_NAME (link);
new file mode 100644
@@ -0,0 +1,12 @@
+// 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;
+ };
+}
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options -fpermissive }
+// { dg-options "-fpermissive -std=c++98" }
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 Sept 2001 <nathan@codesourcery.com>