[cfe-commits] r38848 - in /cfe/cfe/trunk: Parse/ParseStmt.cpp include/clang/Basic/DiagnosticKinds.def
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:25:09 PDT 2007
Author: sabre
Date: Wed Jul 11 11:25:09 2007
New Revision: 38848
URL: http://llvm.org/viewvc/llvm-project?rev=38848&view=rev
Log:
Add a warning
Modified:
cfe/cfe/trunk/Parse/ParseStmt.cpp
cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def
Modified: cfe/cfe/trunk/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseStmt.cpp?rev=38848&r1=38847&r2=38848&view=diff
==============================================================================
--- cfe/cfe/trunk/Parse/ParseStmt.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseStmt.cpp Wed Jul 11 11:25:09 2007
@@ -267,6 +267,8 @@
ConsumeToken();
} else if (isDeclarationSpecifier()) { // for (int X = 4;
// Parse declaration, which eats the ';'.
+ if (!getLang().C99) // Use of C99-style for loops in C90 mode?
+ Diag(Tok, diag::ext_c99_variable_decl_in_for_loop);
ParseDeclaration(Declarator::ForContext);
} else {
ParseExpression();
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=38848&r1=38847&r2=38848&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/cfe/trunk/include/clang/Basic/DiagnosticKinds.def Wed Jul 11 11:25:09 2007
@@ -254,6 +254,8 @@
"type-less parameter names in function declaration")
DIAG(ext_c99_array_usage, EXTENSION,
"use of c99-specific array features")
+DIAG(ext_c99_variable_decl_in_for_loop, EXTENSION,
+ "variable declaration in for loop is a c99-specific feature")
// Generic errors.
DIAG(err_parse_error, ERROR,
More information about the cfe-commits
mailing list