blob: ac4c951584498fd7d6c3b3f3a109c7e0ce426de4 [file] [log] [blame]
Richard Smithbeb44782015-06-20 01:05:19 +00001// RUN: rm -rf %t
2// RUN: %clang_cc1 -fmodules -fmodule-map-file=%S/Inputs/merge-class-definition-visibility/modmap \
3// RUN: -I%S/Inputs/merge-class-definition-visibility \
Richard Smith1e02a5a2015-06-25 21:42:33 +00004// RUN: -fmodules-cache-path=%t %s -verify \
5// RUN: -fmodules-local-submodule-visibility
Richard Smithbeb44782015-06-20 01:05:19 +00006// expected-no-diagnostics
7
8#include "c.h"
9template<typename T> struct X { T t; };
10typedef X<A> XA;
Richard Smith1e02a5a2015-06-25 21:42:33 +000011struct B;
Richard Smithbeb44782015-06-20 01:05:19 +000012
Richard Smith1e02a5a2015-06-25 21:42:33 +000013#include "e.h"
14// Ensure that this triggers the import of the second definition from e.h,
Richard Smithbeb44782015-06-20 01:05:19 +000015// which is necessary to make the definition of A visible in the template
16// instantiation.
17XA xa;
Richard Smith1e02a5a2015-06-25 21:42:33 +000018
19// Ensure that we make the definition of B visible. We made the parse-merged
20// definition from e.h visible, which makes the definition from d.h visible,
21// and that definition was merged into the canonical definition from b.h,
22// so that becomes visible, and we have a visible definition.
23B b;