[cfe-commits] r39238 - in /cfe/cfe/trunk: AST/SemaType.cpp Sema/SemaType.cpp include/clang/Basic/DiagnosticKinds.def

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:41:44 PDT 2007


Author: sabre
Date: Wed Jul 11 11:41:44 2007
New Revision: 39238

URL: http://llvm.org/viewvc/llvm-project?rev=39238&view=rev
Log:
reject int(const void).

Modified:
    cfe/cfe/trunk/AST/SemaType.cpp
    cfe/cfe/trunk/Sema/SemaType.cpp
    cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def

Modified: cfe/cfe/trunk/AST/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaType.cpp?rev=39238&r1=39237&r2=39238&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/SemaType.cpp (original)
+++ cfe/cfe/trunk/AST/SemaType.cpp Wed Jul 11 11:41:44 2007
@@ -159,6 +159,10 @@
               return TypeRef();
             }
             
+            // Reject, but continue to parse 'float(const void)'.
+            if (ArgTy.getQualifiers())
+              Diag(DeclType.Loc, diag::err_void_param_qualified);
+            
             // Do not add 'void' to the ArgTys list.
             break;
           }

Modified: cfe/cfe/trunk/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaType.cpp?rev=39238&r1=39237&r2=39238&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaType.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaType.cpp Wed Jul 11 11:41:44 2007
@@ -159,6 +159,10 @@
               return TypeRef();
             }
             
+            // Reject, but continue to parse 'float(const void)'.
+            if (ArgTy.getQualifiers())
+              Diag(DeclType.Loc, diag::err_void_param_qualified);
+            
             // Do not add 'void' to the ArgTys list.
             break;
           }

Modified: cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=39238&r1=39237&r2=39238&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def Wed Jul 11 11:41:44 2007
@@ -397,6 +397,8 @@
      "void argument may not have a name")
 DIAG(err_void_only_param, ERROR,
      "'void' must be the first and only parameter if specified")
+DIAG(err_void_param_qualified, ERROR,
+     "'void' as parameter must not have type qualifiers")
 
 DIAG(err_unexpected_typedef, ERROR,
      "unexpected type name '%s': expected expression")





More information about the cfe-commits mailing list