diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-16 23:47:08 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-16 23:47:08 +0000 |
commit | 83913e36c847052966d9ff60d760ea7231ed8b6b (patch) | |
tree | 2a81a1391f5542ea6b768ef44e62e42356d30167 /lib/Sema/SemaType.cpp | |
parent | f177a8df322f463fd382fb1588a27308fa728d34 (diff) |
When creating function types, remove any top-level CVR qualifications in the function type argument types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index bbcb1a4689..a56e1ae7b2 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -692,7 +692,7 @@ QualType Sema::BuildFunctionType(QualType T, Invalid = true; } - ParamTypes[Idx] = ParamType; + ParamTypes[Idx] = adjustFunctionParamType(ParamType); } if (Invalid) @@ -1020,8 +1020,11 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, for (unsigned i = 0, e = FTI.NumArgs; i != e; ++i) { ParmVarDecl *Param = FTI.ArgInfo[i].Param.getAs<ParmVarDecl>(); - if (Param) - ArgTys.push_back(Param->getType()); + if (Param) { + QualType ArgTy = adjustFunctionParamType(Param->getType()); + + ArgTys.push_back(ArgTy); + } } SourceTy = Context.getFunctionType(SourceTy, ArgTys.data(), ArgTys.size(), @@ -1144,7 +1147,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, } } - ArgTys.push_back(ArgTy); + ArgTys.push_back(adjustFunctionParamType(ArgTy)); } llvm::SmallVector<QualType, 4> Exceptions; |