r177944 - <rdar://problem/13395022> Strip references when extracting an initializer_list's element type during application of an initialization sequence.

Douglas Gregor dgregor at apple.com
Mon Mar 25 16:47:01 PDT 2013


Author: dgregor
Date: Mon Mar 25 18:47:01 2013
New Revision: 177944

URL: http://llvm.org/viewvc/llvm-project?rev=177944&view=rev
Log:
<rdar://problem/13395022> Strip references when extracting an initializer_list's element type during application of an initialization sequence.

Modified:
    cfe/trunk/lib/Sema/SemaInit.cpp
    cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=177944&r1=177943&r2=177944&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Mon Mar 25 18:47:01 2013
@@ -5464,7 +5464,7 @@ InitializationSequence::Perform(Sema &S,
     case SK_StdInitializerList: {
       QualType Dest = Step->Type;
       QualType E;
-      bool Success = S.isStdInitializerList(Dest, &E);
+      bool Success = S.isStdInitializerList(Dest.getNonReferenceType(), &E);
       (void)Success;
       assert(Success && "Destination type changed?");
 
@@ -5958,7 +5958,7 @@ bool InitializationSequence::Diagnose(Se
     unsigned NumInits = InitList->getNumInits();
     QualType DestType = Entity.getType();
     QualType E;
-    bool Success = S.isStdInitializerList(DestType, &E);
+    bool Success = S.isStdInitializerList(DestType.getNonReferenceType(), &E);
     (void)Success;
     assert(Success && "Where did the std::initializer_list go?");
     InitializedEntity HiddenArray = InitializedEntity::InitializeTemporary(

Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp?rev=177944&r1=177943&r2=177944&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.list/p3-0x.cpp Mon Mar 25 18:47:01 2013
@@ -110,3 +110,13 @@ namespace bullet8 {
   int j { 1 };
   int k { };
 }
+
+namespace rdar13395022 {
+  struct MoveOnly {
+    MoveOnly(MoveOnly&&); // expected-note{{copy constructor is implicitly deleted because 'MoveOnly' has a user-declared move constructor}}
+  };
+
+  void test(MoveOnly mo) {
+    auto &&list = {mo}; // expected-error{{call to implicitly-deleted copy constructor of 'rdar13395022::MoveOnly'}}
+  }
+}





More information about the cfe-commits mailing list