Browse Source

Fixed parser crash with dependent-sized bitfields.

pull/553/head
triton 10 years ago
parent
commit
d6b5fcfe2b
  1. 2
      src/CppParser/Parser.cpp
  2. 3
      tests/Common/Common.h

2
src/CppParser/Parser.cpp

@ -1323,7 +1323,7 @@ Field* Parser::WalkFieldCXX(clang::FieldDecl* FD, Class* Class) @@ -1323,7 +1323,7 @@ Field* Parser::WalkFieldCXX(clang::FieldDecl* FD, Class* Class)
F->Access = ConvertToAccess(FD->getAccess());
F->Class = Class;
F->IsBitField = FD->isBitField();
if (F->IsBitField)
if (F->IsBitField && !F->IsDependent)
F->BitWidth = FD->getBitWidthValue(C->getASTContext());
Class->Fields.push_back(F);

3
tests/Common/Common.h

@ -647,6 +647,9 @@ DLL_API decltype(nullptr) TestNullPtrTypeRet() @@ -647,6 +647,9 @@ DLL_API decltype(nullptr) TestNullPtrTypeRet()
template<typename T> struct DependentType
{
DependentType(typename T::Dependent* t) { }
private:
struct Bitset { int length : sizeof(T); };
};
class PureDtor

Loading…
Cancel
Save