]> granicus.if.org Git - clang/commitdiff
#import is not considered an extension for ObjC.
authorChris Lattner <sabre@nondot.org>
Fri, 6 Mar 2009 04:28:03 +0000 (04:28 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 6 Mar 2009 04:28:03 +0000 (04:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66246 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPDirectives.cpp
test/Preprocessor/objc-pp.m [new file with mode: 0644]

index ce68207eb3b87b0a2e03e6115f114a0dec214ee7..b38ff10c205607a92c47748740905f3ab2d78b32 100644 (file)
@@ -1075,7 +1075,8 @@ void Preprocessor::HandleIncludeNextDirective(Token &IncludeNextTok) {
 /// 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);
 }
diff --git a/test/Preprocessor/objc-pp.m b/test/Preprocessor/objc-pp.m
new file mode 100644 (file)
index 0000000..0648acd
--- /dev/null
@@ -0,0 +1,4 @@
+// RUN: clang %s -fsyntax-only -verify -pedantic
+
+#import <stdio.h>  // no warning.
+