diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2009-09-29 23:01:30 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-09-29 23:01:30 -0400 |
commit | d5f4edddeb609ad93c7a69ad4575b082de8dc707 (patch) | |
tree | a0717adf99d475ef98d9002044972a7ab9c3e5d6 /gcc/cp/class.c | |
parent | 300ea2831b894fc143539fe0319f39062b6e4daf (diff) | |
download | gcc-d5f4edddeb609ad93c7a69ad4575b082de8dc707.zip gcc-d5f4edddeb609ad93c7a69ad4575b082de8dc707.tar.gz gcc-d5f4edddeb609ad93c7a69ad4575b082de8dc707.tar.bz2 |
merge in cxx0x-lambdas-branch@152308
From-SVN: r152318
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 9938a3d..d29d661 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -2677,6 +2677,10 @@ add_implicitly_declared_members (tree t, CLASSTYPE_LAZY_COPY_CTOR (t) = 1; } + /* Currently only lambdas get a lazy move ctor. */ + if (LAMBDA_TYPE_P (t)) + CLASSTYPE_LAZY_MOVE_CTOR (t) = 1; + /* If there is no assignment operator, one will be created if and when it is needed. For now, just record whether or not the type of the parameter to the assignment operator will be a const or @@ -4449,6 +4453,20 @@ check_bases_and_members (tree t) cant_have_const_ctor, no_const_asn_ref); + if (LAMBDA_TYPE_P (t)) + { + /* "The closure type associated with a lambda-expression has a deleted + default constructor and a deleted copy assignment operator." */ + TYPE_NEEDS_CONSTRUCTING (t) = 1; + TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 0; + CLASSTYPE_LAZY_DEFAULT_CTOR (t) = 0; + TYPE_HAS_ASSIGN_REF (t) = 0; + CLASSTYPE_LAZY_ASSIGNMENT_OP (t) = 0; + + /* "This class type is not an aggregate." */ + CLASSTYPE_NON_AGGREGATE (t) = 1; + } + /* Create the in-charge and not-in-charge variants of constructors and destructors. */ clone_constructors_and_destructors (t); @@ -6601,7 +6619,8 @@ maybe_note_name_used_in_class (tree name, tree decl) /* If we're not defining a class, there's nothing to do. */ if (!(innermost_scope_kind() == sk_class - && TYPE_BEING_DEFINED (current_class_type))) + && TYPE_BEING_DEFINED (current_class_type) + && !LAMBDA_TYPE_P (current_class_type))) return; /* If there's already a binding for this NAME, then we don't have |