diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-01-12 20:34:32 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-01-12 20:34:32 +0000 |
| commit | 2de44e658d62f1032111933a5b751f17fc477c55 (patch) | |
| tree | 55daa1a3c6498b6684ff61f4f31908f745f766b7 /clang/test | |
| parent | 3469ee120c753c60875ddc301ea7921700b8730a (diff) | |
| download | bcm5719-llvm-2de44e658d62f1032111933a5b751f17fc477c55.tar.gz bcm5719-llvm-2de44e658d62f1032111933a5b751f17fc477c55.zip | |
[modules] Don't diagnose a conflict between two using-declarations that name equivalent internal linkage entities.
llvm-svn: 257512
Diffstat (limited to 'clang/test')
4 files changed, 17 insertions, 4 deletions
diff --git a/clang/test/Modules/Inputs/using-decl-redecl/a.h b/clang/test/Modules/Inputs/using-decl-redecl/a.h index 477546945c0..eaa1876aac6 100644 --- a/clang/test/Modules/Inputs/using-decl-redecl/a.h +++ b/clang/test/Modules/Inputs/using-decl-redecl/a.h @@ -1,2 +1,3 @@ struct string {}; -namespace N { typedef ::string clstring; } +const int n = 0; +namespace N { typedef ::string clstring; using ::n; } diff --git a/clang/test/Modules/Inputs/using-decl-redecl/d.h b/clang/test/Modules/Inputs/using-decl-redecl/d.h new file mode 100644 index 00000000000..2243de1baf9 --- /dev/null +++ b/clang/test/Modules/Inputs/using-decl-redecl/d.h @@ -0,0 +1 @@ +#include "a.h" diff --git a/clang/test/Modules/Inputs/using-decl-redecl/module.modulemap b/clang/test/Modules/Inputs/using-decl-redecl/module.modulemap index bd6ea830c2d..a2ebc176764 100644 --- a/clang/test/Modules/Inputs/using-decl-redecl/module.modulemap +++ b/clang/test/Modules/Inputs/using-decl-redecl/module.modulemap @@ -1,3 +1,4 @@ module a { header "a.h" } -module b { header "b.h" export * } -module c { header "c.h" export * } +module b { header "b.h" export a } +module c { header "c.h" export a export b } +module d { header "d.h" } diff --git a/clang/test/Modules/using-decl-redecl.cpp b/clang/test/Modules/using-decl-redecl.cpp index 0e78cec1188..0524052fce5 100644 --- a/clang/test/Modules/using-decl-redecl.cpp +++ b/clang/test/Modules/using-decl-redecl.cpp @@ -2,10 +2,20 @@ // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t \ // RUN: -fmodule-map-file=%S/Inputs/using-decl-redecl/module.modulemap \ // RUN: -I%S/Inputs/using-decl-redecl \ +// RUN: -Wno-modules-ambiguous-internal-linkage \ // RUN: -verify %s + +#include "d.h" + +const int n = 0; +namespace M { using ::n; } + #include "c.h" + N::clstring y = b; // Use a typo to trigger import of all declarations in N. N::clstrinh s; // expected-error {{did you mean 'clstring'}} -// expected-note@a.h:2 {{here}} +// expected-note@a.h:3 {{here}} + +namespace M { using N::n; } |

