diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-12 23:21:45 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-12 23:21:45 +0000 |
commit | 8807e830373233ac31be4bf4ddbe6e854e8ebae5 (patch) | |
tree | 48f1f961ca1921e7d9030a014b0d6e9d333b8a54 /clang/test/Modules/merge-decl-order.cpp | |
parent | 5779f840005af201df8f60dfab514e4cafdebd8e (diff) | |
download | bcm5719-llvm-8807e830373233ac31be4bf4ddbe6e854e8ebae5.tar.gz bcm5719-llvm-8807e830373233ac31be4bf4ddbe6e854e8ebae5.zip |
[modules] When collecting declarations to complete a redeclaration chain for an
entity, put the originally-canonical decl IDs in the right places in the redecl
chain rather than reordering them all to the start. If we don't ensure that the
redecl chain order is consistent with the topological module order, we can fail
to make a declaration visible if later declarations are in more IDNSs than
earlier ones (for instance, because the earlier decls are invisible friends).
llvm-svn: 228978
Diffstat (limited to 'clang/test/Modules/merge-decl-order.cpp')
-rw-r--r-- | clang/test/Modules/merge-decl-order.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Modules/merge-decl-order.cpp b/clang/test/Modules/merge-decl-order.cpp new file mode 100644 index 00000000000..d3b21fdf8ae --- /dev/null +++ b/clang/test/Modules/merge-decl-order.cpp @@ -0,0 +1,9 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/merge-decl-order -verify %s +// expected-no-diagnostics + +// Check that we include all decls from 'a' before the decls from 'b' in foo's +// redecl chain. If we don't, then name lookup only finds invisible friend +// declarations and the lookup below will fail. +#include "b.h" +N::foo *use; |