llvm-capstone/clang/test/Modules/using-decl-friend.cpp
Richard Smith 041740ff69 When name lookup finds a non-imported declaration and looks back along the
redecl chain for an imported declaration, make sure to check the IDNS of prior
imported decls.

Otherwise we can end up finding an invisible friend declaration and incorrectly
believing that it should be visible.

llvm-svn: 321916
2018-01-06 00:09:23 +00:00

38 lines
661 B
C++

// RUN: %clang_cc1 -fmodules %s -verify
// expected-no-diagnostics
#pragma clang module build A
module A {}
#pragma clang module contents
#pragma clang module begin A
namespace N {
class X;
}
#pragma clang module end
#pragma clang module endbuild
#pragma clang module build B
module B {
module X {}
module Y {}
}
#pragma clang module contents
#pragma clang module begin B.X
namespace N {
class Friendly {
friend class X;
};
}
#pragma clang module end
#pragma clang module begin B.Y
namespace N {
class X;
}
#pragma clang module end
#pragma clang module endbuild
#pragma clang module import A
#pragma clang module import B.X
using N::X;
X *p;