diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-01-24 01:07:20 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-01-24 01:07:20 +0000 |
| commit | 8a63989728b67584e64800e1f4c586f8c0acbfa7 (patch) | |
| tree | bbff117d868c80a4ba00d6ecf8ede1ade84e6cba /clang/test/Modules | |
| parent | ad363ad8042f44e8006554a6447fc46807d1a9ed (diff) | |
| download | bcm5719-llvm-8a63989728b67584e64800e1f4c586f8c0acbfa7.tar.gz bcm5719-llvm-8a63989728b67584e64800e1f4c586f8c0acbfa7.zip | |
[modules] Sometimes we can deserialize a class member but not have yet
encountered any definition for the class; this happens when the definition is
added by an update record that is not yet loaded. In such a case, eagerly pick
the original parent of the member as the canonical definition of the class
rather than muddling through with the canonical declaration (the latter can
lead to us failing to merge properly later if the canonical definition turns
out to be some other declaration).
llvm-svn: 226977
Diffstat (limited to 'clang/test/Modules')
6 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/merge-nested-templates/a.h b/clang/test/Modules/Inputs/merge-nested-templates/a.h new file mode 100644 index 00000000000..826d2571fd1 --- /dev/null +++ b/clang/test/Modules/Inputs/merge-nested-templates/a.h @@ -0,0 +1 @@ +#include "string.ii" diff --git a/clang/test/Modules/Inputs/merge-nested-templates/b.h b/clang/test/Modules/Inputs/merge-nested-templates/b.h new file mode 100644 index 00000000000..516694e38e9 --- /dev/null +++ b/clang/test/Modules/Inputs/merge-nested-templates/b.h @@ -0,0 +1,2 @@ +#include "a.h" +std::wstring::iterator j; diff --git a/clang/test/Modules/Inputs/merge-nested-templates/c.h b/clang/test/Modules/Inputs/merge-nested-templates/c.h new file mode 100644 index 00000000000..ab95e145ef5 --- /dev/null +++ b/clang/test/Modules/Inputs/merge-nested-templates/c.h @@ -0,0 +1,3 @@ +#include "string.ii" +std::wstring::iterator i; +#include "b.h" diff --git a/clang/test/Modules/Inputs/merge-nested-templates/module.modulemap b/clang/test/Modules/Inputs/merge-nested-templates/module.modulemap new file mode 100644 index 00000000000..77e0a89e39a --- /dev/null +++ b/clang/test/Modules/Inputs/merge-nested-templates/module.modulemap @@ -0,0 +1,3 @@ +module a { header "a.h" export * } +module b { header "b.h" export * } +module c { header "c.h" export * } diff --git a/clang/test/Modules/Inputs/merge-nested-templates/string.ii b/clang/test/Modules/Inputs/merge-nested-templates/string.ii new file mode 100644 index 00000000000..136d8e70083 --- /dev/null +++ b/clang/test/Modules/Inputs/merge-nested-templates/string.ii @@ -0,0 +1,14 @@ +namespace std { + template <typename, typename Container> struct normal_iterator { + normal_iterator() {} + + template <typename I> + normal_iterator(normal_iterator<I, typename Container::iterator>) {} + }; + + template <typename pointer> struct basic_string { + typedef normal_iterator<pointer, basic_string> iterator; + }; + + typedef basic_string<wchar_t *> wstring; +} diff --git a/clang/test/Modules/merge-nested-templates.cpp b/clang/test/Modules/merge-nested-templates.cpp new file mode 100644 index 00000000000..42764eaed64 --- /dev/null +++ b/clang/test/Modules/merge-nested-templates.cpp @@ -0,0 +1,4 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/merge-nested-templates -verify %s +// expected-no-diagnostics +#include "c.h" |

