]> granicus.if.org Git - clang/commitdiff
PR30508: Downgrade error to warning if the umbrella folder doesn't exist.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Tue, 18 Apr 2017 20:57:29 +0000 (20:57 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Tue, 18 Apr 2017 20:57:29 +0000 (20:57 +0000)
Patch by Yuka Takahashi (D32119)!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300594 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticLexKinds.td
lib/Lex/ModuleMap.cpp
test/Modules/umbrella-header-include-builtin.mm

index 7f7022b49e3df421c27591426acfb36560ce656f..b5b5acbc7809280682fe47c294d085bac6f0b112 100644 (file)
@@ -594,8 +594,6 @@ def err_mmap_expected_mmap_file : Error<"expected a module map file name">;
 def err_mmap_module_redefinition : Error<
   "redefinition of module '%0'">;
 def note_mmap_prev_definition : Note<"previously defined here">;
-def err_mmap_umbrella_dir_not_found : Error<
-  "umbrella directory '%0' not found">;
 def err_mmap_umbrella_clash : Error<
   "umbrella for module '%0' already covers this directory">;
 def err_mmap_module_id : Error<
@@ -656,6 +654,9 @@ def note_implicit_top_level_module_import_here : Note<
 def warn_uncovered_module_header : Warning<
   "umbrella header for module '%0' does not include header '%1'">, 
   InGroup<IncompleteUmbrella>;
+def warn_mmap_umbrella_dir_not_found : Warning<
+  "umbrella directory '%0' not found">,
+  InGroup<IncompleteUmbrella>;
 def err_expected_id_building_module : Error<
   "expected a module name in '__building_module' expression">;
 def warn_use_of_private_header_outside_module : Warning<
index 4f3db8dd6436037cda9f8b2fa575d5e941c6a258..5b60ed3f812a923d0deda88f3d4a1529eb935908 100644 (file)
@@ -2002,9 +2002,8 @@ void ModuleMapParser::parseUmbrellaDirDecl(SourceLocation UmbrellaLoc) {
   }
   
   if (!Dir) {
-    Diags.Report(DirNameLoc, diag::err_mmap_umbrella_dir_not_found)
+    Diags.Report(DirNameLoc, diag::warn_mmap_umbrella_dir_not_found)
       << DirName;
-    HadError = true;
     return;
   }
 
index 75b9c905ff001b690c2b31c74e6ba4ef4b5a4aed..da21779683cf78edcab032fe27549a63529432d2 100644 (file)
@@ -4,3 +4,11 @@
 // RUN: %clang -cc1 -fsyntax-only -nostdinc++ -isysroot %S/Inputs/libc-libcxx/sysroot -isystem %S/Inputs/libc-libcxx/sysroot/usr/include/c++/v1 -F%S/Inputs/libc-libcxx/sysroot/Frameworks -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c++ %s
 
 #include <A/A.h>
+
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo "module NonExistent1 { umbrella \"NonExistent\" }" > %t/modules.modulemap
+// RUN: echo "" > %t/A.h
+// RUN: echo "#include \"A.h\"  int i;" > %t/T.cxx
+// RUN: %clang -I %t -fmodules -fsyntax-only %t/T.cxx
+// expected-warning {{ umbrella directory }}