blob: cdda48ea65211b507e3105d8f7f9382e1f2a222b [file] [log] [blame]
Richard Smith65ebb4a2015-03-26 04:09:53 +00001// RUN: rm -rf %t
Richard Smithbe3980b2015-03-27 00:41:57 +00002// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules-cache-path=%t -fmodules -I %S/Inputs/submodules-merge-defs %s -verify -fno-modules-error-recovery
Richard Smith65ebb4a2015-03-26 04:09:53 +00003
4// Trigger import of definitions, but don't make them visible.
5#include "empty.h"
6
7A pre_a; // expected-error {{must be imported}} expected-error {{must use 'struct'}}
8// expected-note@defs.h:1 {{here}}
9
Richard Smithbe3980b2015-03-27 00:41:57 +000010B::Inner2 pre_bi; // expected-error +{{must be imported}}
11// expected-note@defs.h:4 +{{here}}
12// expected-note@defs.h:10 +{{here}}
13
14C_Base<1> pre_cb1; // expected-error +{{must be imported}}
15// expected-note@defs.h:13 +{{here}}
16C1 pre_c1; // expected-error +{{must be imported}} expected-error {{must use 'struct'}}
17// expected-note@defs.h:15 +{{here}}
18C2 pre_c2; // expected-error +{{must be imported}} expected-error {{must use 'struct'}}
19// expected-note@defs.h:16 +{{here}}
20
Richard Smitha5230222015-03-27 01:37:43 +000021D::X pre_dx; // expected-error +{{must be imported}}
22// expected-note@defs.h:18 +{{here}}
23// expected-note@defs.h:19 +{{here}}
24
Richard Smith65ebb4a2015-03-26 04:09:53 +000025// Make definitions from second module visible.
26#include "import-and-redefine.h"
27
28A post_a;
Richard Smithbe3980b2015-03-27 00:41:57 +000029B::Inner2 post_bi;
30C_Base<1> post_cb1;
31C1 c1;
32C2 c2;
Richard Smitha5230222015-03-27 01:37:43 +000033D::X post_dx;