diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-05-17 00:24:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-05-17 00:24:14 +0000 |
commit | 26342f915bd615900c652afd3c807a4fc195ac9f (patch) | |
tree | 1893d297ea1cf44fa0484cc6481b9a5d75da1667 /clang/test/Modules/Inputs/submodule-visibility | |
parent | 9c99faa8563c11895b44d8e59c1a96216dfb17f7 (diff) | |
download | bcm5719-llvm-26342f915bd615900c652afd3c807a4fc195ac9f.tar.gz bcm5719-llvm-26342f915bd615900c652afd3c807a4fc195ac9f.zip |
[modules] When creating a declaration, cache its owning module immediately
rather than waiting until it's queried.
Currently this is only applied to local submodule visibility mode, as we don't
yet allocate storage for the owning module in non-local-visibility modules
compilations.
This reinstates r302965, reverted in r303037, with a fix for the reported
crash, which occurred when reparenting a local declaration to be a child of
a hidden imported declaration (specifically during template instantiation).
llvm-svn: 303224
Diffstat (limited to 'clang/test/Modules/Inputs/submodule-visibility')
-rw-r--r-- | clang/test/Modules/Inputs/submodule-visibility/b.h | 6 | ||||
-rw-r--r-- | clang/test/Modules/Inputs/submodule-visibility/other.h | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/Modules/Inputs/submodule-visibility/b.h b/clang/test/Modules/Inputs/submodule-visibility/b.h index 67ef6529dbd..39df6a02cb4 100644 --- a/clang/test/Modules/Inputs/submodule-visibility/b.h +++ b/clang/test/Modules/Inputs/submodule-visibility/b.h @@ -4,7 +4,11 @@ int m = n; #include "c.h" #if defined(A) && !defined(ALLOW_NAME_LEAKAGE) -#error A is defined +#warning A is defined #endif #define B + +template<typename T> void b_template() { + N::C::f(0); +} diff --git a/clang/test/Modules/Inputs/submodule-visibility/other.h b/clang/test/Modules/Inputs/submodule-visibility/other.h index f40c757ca62..4b68c489153 100644 --- a/clang/test/Modules/Inputs/submodule-visibility/other.h +++ b/clang/test/Modules/Inputs/submodule-visibility/other.h @@ -1 +1,10 @@ #include "c.h" + +#ifndef OTHER_H +#define OTHER_H +namespace N { + struct C { + template<typename U> static void f(U) {} + }; +} +#endif |