diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-02-19 03:00:56 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-02-19 03:00:56 +0000 |
commit | f703b588b8ca7d401c45416d37dca602844a716f (patch) | |
tree | c60a0f7ebe133fca4fc11c3fbd194c2859d0ecda /clang/lib/Sema/SemaDecl.cpp | |
parent | f903a44728c514456bac5577d2baf54afa7d5a0f (diff) | |
download | bcm5719-llvm-f703b588b8ca7d401c45416d37dca602844a716f.tar.gz bcm5719-llvm-f703b588b8ca7d401c45416d37dca602844a716f.zip |
Implement DR577
DR18 previously forebode typedefs to be used as parameter types if they
were of type 'void'. DR577 allows 'void' to be used as a function
parameter type regardless from where it came.
llvm-svn: 201631
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 72210757f34..c147681f03f 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -6357,22 +6357,6 @@ static FunctionDecl* CreateNewFunctionDecl(Sema &SemaRef, Declarator &D, } } -void Sema::checkVoidParamDecl(ParmVarDecl *Param) { - // In C++, the empty parameter-type-list must be spelled "void"; a - // typedef of void is not permitted. - if (getLangOpts().CPlusPlus && - Param->getType().getUnqualifiedType() != Context.VoidTy) { - bool IsTypeAlias = false; - if (const TypedefType *TT = Param->getType()->getAs<TypedefType>()) - IsTypeAlias = isa<TypeAliasDecl>(TT->getDecl()); - else if (const TemplateSpecializationType *TST = - Param->getType()->getAs<TemplateSpecializationType>()) - IsTypeAlias = TST->isTypeAlias(); - Diag(Param->getLocation(), diag::err_param_typedef_of_void) - << IsTypeAlias; - } -} - enum OpenCLParamType { ValidKernelParam, PtrPtrKernelParam, @@ -6915,7 +6899,6 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, FTI.ArgInfo[0].Param && cast<ParmVarDecl>(FTI.ArgInfo[0].Param)->getType()->isVoidType()) { // Empty arg list, don't push any params. - checkVoidParamDecl(cast<ParmVarDecl>(FTI.ArgInfo[0].Param)); } else if (FTI.NumArgs > 0 && FTI.ArgInfo[0].Param != 0) { for (unsigned i = 0, e = FTI.NumArgs; i != e; ++i) { ParmVarDecl *Param = cast<ParmVarDecl>(FTI.ArgInfo[i].Param); |