[cfe-commits] r38830 - in /cfe/cfe/trunk: Parse/ParseDecl.cpp include/clang/Basic/DiagnosticKinds.def

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:25:00 PDT 2007


Author: sabre
Date: Wed Jul 11 11:25:00 2007
New Revision: 38830

URL: http://llvm.org/viewvc/llvm-project?rev=38830&view=rev
Log:
Warn for c99-specific array use

Modified:
    cfe/cfe/trunk/Parse/ParseDecl.cpp
    cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def

Modified: cfe/cfe/trunk/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseDecl.cpp?rev=38830&r1=38829&r2=38830&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseDecl.cpp Wed Jul 11 11:25:00 2007
@@ -577,6 +577,8 @@
   // it was not a constant expression.
   if (!getLang().C99) {
     // TODO: check C90 array constant exprness.
+    if (isStar || StaticLoc.isValid() || 0/*constantexpr*/)
+      Diag(StartLoc, diag::ext_c99_array_usage);
   }
 }
 

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=38830&r1=38829&r2=38830&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def Wed Jul 11 11:25:00 2007
@@ -252,6 +252,8 @@
 
 DIAG(ext_ident_list_in_param, EXTENSION,
      "type-less parameter names in function declaration")
+DIAG(ext_c99_array_usage, EXTENSION,
+     "use of c99-specific array features")
 
 DIAG(err_parse_error, ERROR,
      "parse error")





More information about the cfe-commits mailing list