Browse Source

Fix crash when trying to read a CXXRecordDecl that doesn't have a definition (#1426)

pull/1431/head
josetr 5 years ago committed by GitHub
parent
commit
8034acb22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/CppParser/Parser.cpp
  2. 12
      tests/CSharp/CSharp.h

3
src/CppParser/Parser.cpp

@ -1073,6 +1073,9 @@ void Parser::WalkRecordCXX(const clang::CXXRecordDecl* Record, Class* RC) @@ -1073,6 +1073,9 @@ void Parser::WalkRecordCXX(const clang::CXXRecordDecl* Record, Class* RC)
Sema.ForceDeclarationOfImplicitMembers(const_cast<clang::CXXRecordDecl*>(Record));
WalkRecord(Record, RC);
if (!Record->hasDefinition())
return;
RC->isPOD = Record->isPOD();
RC->isAbstract = Record->isAbstract();

12
tests/CSharp/CSharp.h

@ -1405,3 +1405,15 @@ DLL_API boolean_t takeTypemapTypedefParam(boolean_t b); @@ -1405,3 +1405,15 @@ DLL_API boolean_t takeTypemapTypedefParam(boolean_t b);
class DLL_API TestAnonymousMemberNameCollision : public ClassUsingUnion {
};
namespace CXXRecordDeclWithoutDefinition
{
template<typename... T>
struct list;
template<typename T>
struct it;
template <> struct it<list<>> { };
template <> struct it<list<> const> { };
}
Loading…
Cancel
Save