llvm-project/clang/test/Modules/submodule-visibility-cycles.cpp
Richard Smith 04765ae01e [modules] If we re-enter a submodule from within itself (when submodule
visibility is enabled) or leave and re-enter it, restore the macro and module
visibility state from last time we were in that submodule.

This allows mutually-#including header files to stand a chance at being
modularized with local visibility enabled.

llvm-svn: 237871
2015-05-21 01:20:10 +00:00

11 lines
339 B
C++

// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fno-modules-error-recovery -fmodules-local-submodule-visibility -fmodules-cache-path=%t -I%S/Inputs/submodule-visibility -verify %s
#include "cycle1.h"
C1 c1;
C2 c2; // expected-error {{must be imported}} expected-error {{}}
// expected-note@cycle2.h:6 {{here}}
#include "cycle2.h"
C2 c3;