blob: 10e1914bd7b847b98dede73e1b034e3535ef9bf3 [file] [log] [blame]
Richard Smith86dfc1e2015-06-18 22:07:00 +00001// RUN: rm -rf %t
2// RUN: mkdir %t
3// RUN: echo 'namespace N { enum E { A }; }' > %t/a.h
4// RUN: echo '#include "a.h"' > %t/b.h
5// RUN: touch %t/x.h
6// RUN: echo 'module B { module b { header "b.h" } module x { header "x.h" } }' > %t/b.modulemap
Richard Smithedcc92a2015-11-05 01:30:19 +00007// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -x c++ -fmodule-map-file=%t/b.modulemap %s -I%t -verify -fmodules-local-submodule-visibility
8// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -x c++ -fmodule-map-file=%t/b.modulemap %s -I%t -verify -fmodules-local-submodule-visibility -DMERGE_LATE
9
10#ifndef MERGE_LATE
Richard Smith86dfc1e2015-06-18 22:07:00 +000011// expected-no-diagnostics
12#include "a.h"
Richard Smithedcc92a2015-11-05 01:30:19 +000013#endif
14
Richard Smith86dfc1e2015-06-18 22:07:00 +000015#include "x.h"
Richard Smithedcc92a2015-11-05 01:30:19 +000016
17#ifdef MERGE_LATE
18namespace N {
Richard Smith97135cc2015-11-12 22:19:45 +000019 enum { A } a; // expected-note {{candidate}}
20 // expected-note@a.h:1 {{candidate}} (from module B.b)
Richard Smithedcc92a2015-11-05 01:30:19 +000021}
22#include "a.h"
23#endif
24
Richard Smith86dfc1e2015-06-18 22:07:00 +000025N::E e = N::A;
Richard Smith97135cc2015-11-12 22:19:45 +000026#ifdef MERGE_LATE
27// expected-error@-2 {{ambiguous}}
28#endif