def err_unexpected_at : Error<"unexpected '@' in program">;
def err_atimport : Error<
-"use of '@import' when modules are disabled">;
+ "use of '@import' when modules are disabled">;
+def err_atimport_cxx : Error<
+ "use of '@import' when C++ modules are disabled, consider using fmodules "
+ "and fcxx-modules">;
def err_invalid_reference_qualifier_application : Error<
"'%0' qualifier may not be applied to a reference">;
case tok::objc_import:
if (getLangOpts().Modules || getLangOpts().DebuggerSupport)
return ParseModuleImport(AtLoc);
- Diag(AtLoc, diag::err_atimport);
+ if (getLangOpts().CPlusPlus)
+ Diag(AtLoc, diag::err_atimport_cxx);
+ else
+ Diag(AtLoc, diag::err_atimport);
SkipUntil(tok::semi);
return Actions.ConvertDeclToDeclGroup(nullptr);
default:
--- /dev/null
+// RUN: not %clang -fmodules -fno-cxx-modules -fsyntax-only %s 2>&1 | FileCheck %s
+// rdar://19399671
+
+// CHECK: use of '@import' when C++ modules are disabled
+@import Foundation;