Loosen the precondition of isCXXInstanceMember() to simply return
"false" for declarations that aren't members of classes. Fixes PR12106. llvm-svn: 152284
This commit is contained in:
parent
dd1637c393
commit
3f28ec28d5
|
@ -205,8 +205,8 @@ public:
|
|||
return DC->isRecord();
|
||||
}
|
||||
|
||||
/// \brief Given that this declaration is a C++ class member,
|
||||
/// determine whether it's an instance member of its class.
|
||||
/// \brief Determine whether the given declaration is an instance member of
|
||||
/// a C++ class.
|
||||
bool isCXXInstanceMember() const;
|
||||
|
||||
class LinkageInfo {
|
||||
|
|
|
@ -997,9 +997,9 @@ NamedDecl *NamedDecl::getUnderlyingDecl() {
|
|||
}
|
||||
|
||||
bool NamedDecl::isCXXInstanceMember() const {
|
||||
assert(isCXXClassMember() &&
|
||||
"checking whether non-member is instance member");
|
||||
|
||||
if (!isCXXClassMember())
|
||||
return false;
|
||||
|
||||
const NamedDecl *D = this;
|
||||
if (isa<UsingShadowDecl>(D))
|
||||
D = cast<UsingShadowDecl>(D)->getTargetDecl();
|
||||
|
|
|
@ -174,3 +174,13 @@ namespace N2764 {
|
|||
}
|
||||
|
||||
enum class N2764::B {};
|
||||
|
||||
namespace PR12106 {
|
||||
template<typename E> struct Enum {
|
||||
Enum() : m_e(E::Last) {}
|
||||
E m_e;
|
||||
};
|
||||
|
||||
enum eCOLORS { Last };
|
||||
Enum<eCOLORS> e;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue