diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-10 02:26:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-10 02:26:16 +0000 |
commit | 0e91b419023b9270ee6cc36982bebb4e68f4a837 (patch) | |
tree | 4173f19944d5ad94d8031faf5fdd8142550aa8ce /clang/lib | |
parent | 58258246ec920a7c83f8c2fd8b46646f8336f68b (diff) | |
download | bcm5719-llvm-0e91b419023b9270ee6cc36982bebb4e68f4a837.tar.gz bcm5719-llvm-0e91b419023b9270ee6cc36982bebb4e68f4a837.zip |
typedef void T;
void f(T);
is only invalid in C++ mode, not C89 mode.
llvm-svn: 49460
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 803f527e504..27825dbef65 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -841,9 +841,9 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { // empty arg list, don't push any params. ParmVarDecl *Param = (ParmVarDecl*)FTI.ArgInfo[0].Param; - // In C++ and C89, the empty parameter-type-list must be - // spelled "void"; a typedef of void is not permitted. - if (!getLangOptions().C99 && + // In C++, the empty parameter-type-list must be spelled "void"; a + // typedef of void is not permitted. + if (getLangOptions().CPlusPlus && Param->getType() != Context.VoidTy) { Diag(Param->getLocation(), diag::ext_param_typedef_of_void); } |