summaryrefslogtreecommitdiffstats
path: root/test/Modules/tag-injection.cpp
blob: 75c8b5fecdb4aae0f9f42f635ef1f47a2778162f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: touch %t/a.h
// RUN: echo 'struct X {};' > %t/b.h
// RUN: echo 'module X { module a { header "a.h" } module b { header "b.h" } }' > %t/x.modulemap
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -x c++ -fmodule-map-file=%t/x.modulemap %s -I%t -verify -fmodules-local-submodule-visibility -std=c++11

#include "a.h"

struct A {
  // This use of 'struct X' makes the declaration (but not definition) of X visible.
  virtual void f(struct X *p);
};

namespace N {
  struct B : A {
    void f(struct X *q) override;
  };
}

X x; // expected-error {{definition of 'X' must be imported from module 'X.b' before it is required}}
// expected-note@b.h:1 {{here}}
OpenPOWER on IntegriCloud