Browse Source

Fixed a regression when having an array with dependent elements.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/547/head
Dimitar Dobrev 10 years ago
parent
commit
89483ec17a
  1. 3
      src/CppParser/Parser.cpp
  2. 2
      tests/Common/Common.h

3
src/CppParser/Parser.cpp

@ -1754,7 +1754,8 @@ Type* Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL,
A->QualifiedType = GetQualifiedType(ElemTy, WalkType(ElemTy, &Next)); A->QualifiedType = GetQualifiedType(ElemTy, WalkType(ElemTy, &Next));
A->SizeType = ArrayType::ArraySize::Constant; A->SizeType = ArrayType::ArraySize::Constant;
A->Size = AST->getConstantArrayElementCount(AT); A->Size = AST->getConstantArrayElementCount(AT);
A->ElementSize = (long)AST->getTypeSize(ElemTy); if (!ElemTy->isDependentType())
A->ElementSize = (long)AST->getTypeSize(ElemTy);
Ty = A; Ty = A;
break; break;

2
tests/Common/Common.h

@ -420,6 +420,8 @@ class HasIgnoredField
template <typename T> template <typename T>
class DependentTypeWithNestedIndependent class DependentTypeWithNestedIndependent
{ {
T array[1];
union union
{ {
int i; int i;

Loading…
Cancel
Save