[cfe-commits] r85420 - in /cfe/trunk/lib/Sema: SemaDecl.cpp SemaDeclCXX.cpp

Fariborz Jahanian fjahanian at apple.com
Wed Oct 28 12:04:37 PDT 2009


Author: fjahanian
Date: Wed Oct 28 14:04:36 2009
New Revision: 85420

URL: http://llvm.org/viewvc/llvm-project?rev=85420&view=rev
Log:
Use array's base element type in getting to its
constructor. WIP.


Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=85420&r1=85419&r2=85420&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Oct 28 14:04:36 2009
@@ -3443,7 +3443,7 @@
     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,

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=85420&r1=85419&r2=85420&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Oct 28 14:04:36 2009
@@ -3236,7 +3236,7 @@
   // 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(),





More information about the cfe-commits mailing list