[cfe-commits] r66246 - in /cfe/trunk: lib/Lex/PPDirectives.cpp test/Preprocessor/objc-pp.m

Chris Lattner sabre at nondot.org
Thu Mar 5 20:28:04 PST 2009


Author: lattner
Date: Thu Mar  5 22:28:03 2009
New Revision: 66246

URL: http://llvm.org/viewvc/llvm-project?rev=66246&view=rev
Log:
#import is not considered an extension for ObjC.

Added:
    cfe/trunk/test/Preprocessor/objc-pp.m
Modified:
    cfe/trunk/lib/Lex/PPDirectives.cpp

Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=66246&r1=66245&r2=66246&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Thu Mar  5 22:28:03 2009
@@ -1075,7 +1075,8 @@
 /// HandleImportDirective - Implements #import.
 ///
 void Preprocessor::HandleImportDirective(Token &ImportTok) {
-  Diag(ImportTok, diag::ext_pp_import_directive);
+  if (!Features.ObjC1)  // #import is standard for ObjC.
+    Diag(ImportTok, diag::ext_pp_import_directive);
   
   return HandleIncludeDirective(ImportTok, 0, true);
 }

Added: cfe/trunk/test/Preprocessor/objc-pp.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/objc-pp.m?rev=66246&view=auto

==============================================================================
--- cfe/trunk/test/Preprocessor/objc-pp.m (added)
+++ cfe/trunk/test/Preprocessor/objc-pp.m Thu Mar  5 22:28:03 2009
@@ -0,0 +1,4 @@
+// RUN: clang %s -fsyntax-only -verify -pedantic
+
+#import <stdio.h>  // no warning.
+





More information about the cfe-commits mailing list