]> granicus.if.org Git - clang/commitdiff
Use array's base element type in getting to its
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Oct 2009 19:04:36 +0000 (19:04 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Oct 2009 19:04:36 +0000 (19:04 +0000)
constructor. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85420 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp

index 5e433de3bbfa35177c2559b4f4fb179fce7aeee3..a86857990a0fecd83aad6ad13c775d8d24d71501 100644 (file)
@@ -3443,7 +3443,7 @@ void Sema::ActOnUninitializedDecl(DeclPtrTy dcl,
     if (getLangOptions().CPlusPlus) {
       QualType InitType = Type;
       if (const ArrayType *Array = Context.getAsArrayType(Type))
-        InitType = Array->getElementType();
+        InitType = Context.getBaseElementType(Array);
       if ((!Var->hasExternalStorage() && !Var->isExternC()) &&
           InitType->isRecordType() && !InitType->isDependentType()) {
         if (!RequireCompleteType(Var->getLocation(), InitType,
index 4c7705b815d3cf6a9407e8387d07d912f5da884f..01ab0a7241dc157e5e074ec69a15fdb46cb8f13b 100644 (file)
@@ -3236,7 +3236,7 @@ void Sema::AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
   // class type.
   QualType DeclInitType = VDecl->getType();
   if (const ArrayType *Array = Context.getAsArrayType(DeclInitType))
-    DeclInitType = Array->getElementType();
+    DeclInitType = Context.getBaseElementType(Array);
 
   // FIXME: This isn't the right place to complete the type.
   if (RequireCompleteType(VDecl->getLocation(), VDecl->getType(),