diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-06-03 22:19:42 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-06-03 22:19:42 +0200 |
commit | e9b398aef87d9fb8a1ca8d777bb084d43cadf702 (patch) | |
tree | ec4e16abb2986a64c32848ffa5026f025be5b54f | |
parent | 543ad675a6dd1a89019afc297ad052ca02aacc35 (diff) | |
download | gcc-e9b398aef87d9fb8a1ca8d777bb084d43cadf702.zip gcc-e9b398aef87d9fb8a1ca8d777bb084d43cadf702.tar.gz gcc-e9b398aef87d9fb8a1ca8d777bb084d43cadf702.tar.bz2 |
re PR c++/49276 ([C++0x] Segmentation fault with default lambda parameter in member function)
PR c++/49276
* mangle.c (write_nested_name): Use CP_DECL_CONTEXT instead of
DECL_CONTEXT.
* g++.dg/cpp0x/lambda/lambda-mangle2.C: New test.
From-SVN: r174619
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle2.C | 21 |
4 files changed, 35 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b53331d..2e70bc6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-06-03 Jakub Jelinek <jakub@redhat.com> + + PR c++/49276 + * mangle.c (write_nested_name): Use CP_DECL_CONTEXT instead of + DECL_CONTEXT. + 2011-06-01 Jason Merrill <jason@redhat.com> * pt.c (build_non_dependent_expr): Remove special handling of diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 7ecfefb..134c9ea 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1,6 +1,6 @@ /* Name mangling for the 3.0 C++ ABI. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, + 2011 Free Software Foundation, Inc. Written by Alex Samuel <samuel@codesourcery.com> This file is part of GCC. @@ -943,7 +943,7 @@ write_nested_name (const tree decl) else { /* No, just use <prefix> */ - write_prefix (DECL_CONTEXT (decl)); + write_prefix (CP_DECL_CONTEXT (decl)); write_unqualified_name (decl); } write_char ('E'); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 91bed17..781d752 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-03 Jakub Jelinek <jakub@redhat.com> + + PR c++/49276 + * g++.dg/cpp0x/lambda/lambda-mangle2.C: New test. + 2011-06-03 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/headers.m: Do not include sarray.h and hash.h. diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle2.C new file mode 100644 index 0000000..4b7d15a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle2.C @@ -0,0 +1,21 @@ +// PR c++/49276 +// { dg-do compile } +// { dg-options "-std=c++0x" } + +template <int N> +struct F +{ + template <typename U> F (U); +}; + +struct S +{ + void foo (F <0> x = [] {}) {} +}; + +int +main () +{ + S s; + s.foo (); +} |