summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/modular_maps.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-10-22 08:09:47 +0000
committerDaniel Jasper <djasper@google.com>2013-10-22 08:09:47 +0000
commit97da9178ce5167da1bbad45ffcbb80b067a6f7f2 (patch)
treebf472689291f0acd800f76212155a804afff2313 /clang/test/Modules/modular_maps.cpp
parent2f8dc08b8cf4a18c09ec7ca8eb2b619f22cbfbd0 (diff)
downloadbcm5719-llvm-97da9178ce5167da1bbad45ffcbb80b067a6f7f2.tar.gz
bcm5719-llvm-97da9178ce5167da1bbad45ffcbb80b067a6f7f2.zip
Allow a header to be part of multiple modules.
This patch changes two things: a) Allow a header to be part of multiple modules. The reasoning is that in existing codebases that have a module-like build system, the same headers might be used in several build targets. Simple reasons might be that they defined different classes that are declared in the same header. Supporting a header as a part of multiple modules will make the transistion easier for those cases. A later step in clang can then determine whether the two modules are actually compatible and can be merged and error out appropriately. The later check is similar to what needs to be done for template specializations anyway. b) Allow modules to be stored in a directory tree separate from the headers they describe. Review: http://llvm-reviews.chandlerc.com/D1951 llvm-svn: 193151
Diffstat (limited to 'clang/test/Modules/modular_maps.cpp')
-rw-r--r--clang/test/Modules/modular_maps.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/Modules/modular_maps.cpp b/clang/test/Modules/modular_maps.cpp
index 5070f7d5bf9..9c9aba85a91 100644
--- a/clang/test/Modules/modular_maps.cpp
+++ b/clang/test/Modules/modular_maps.cpp
@@ -1,6 +1,8 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodule-map-file=%S/Inputs/modular_maps/modulea.map -I %S/Inputs/modular_maps %s -verify
+#include "common.h"
#include "a.h"
#include "b.h" // expected-error {{private header}}
-const int val = a + b; // expected-error {{undeclared identifier}}
+const int v = a + c;
+const int val = a + b + c; // expected-error {{undeclared identifier}}
OpenPOWER on IntegriCloud