From 680a3f3581fe9f17802522eeafa403b9c9dfa34a Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 28 Oct 2009 19:04:36 +0000 Subject: [PATCH] Use array's base element type in getting to its constructor. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85420 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDecl.cpp | 2 +- lib/Sema/SemaDeclCXX.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 5e433de3bb..a86857990a 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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, diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 4c7705b815..01ab0a7241 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -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(), -- 2.40.0