llvm-capstone/clang/test/Modules/using-directive-redecl.cpp
Richard Smith a544c51e94 [modules] Retain multiple using-directives in the same scope even if they name the same namespace.
They might have different visibility, and thus discarding all but one of them
can result in rejecting valid code. Also fix name lookup to cope with multiple
using-directives being found that denote the same namespace, where some are not
visible -- don't cache an "already visited" state for a using-directive that we
didn't visit because it was hidden.

llvm-svn: 316965
2017-10-30 22:38:20 +00:00

38 lines
856 B
C++

// RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -verify %s
// expected-no-diagnostics
#pragma clang module build M
module M { module TDFNodes {} module TDFInterface {} }
#pragma clang module contents
// TDFNodes
#pragma clang module begin M.TDFNodes
namespace Detail {
namespace TDF {
class TLoopManager {};
}
}
namespace Internal {
namespace TDF {
using namespace Detail::TDF;
}
}
#pragma clang module end
// TDFInterface
#pragma clang module begin M.TDFInterface
#pragma clang module import M.TDFNodes
namespace Internal {
namespace TDF {
using namespace Detail::TDF;
}
}
#pragma clang module end
#pragma clang module endbuild
#pragma clang module import M.TDFNodes
namespace Internal {
namespace TDF {
TLoopManager * use;
}
}