File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -341,8 +341,20 @@ public override bool VisitProperty(Property property)
341
341
WriteLine ( $ "_S->{ fieldName } = static_cast<AST::{ typeName } >(" +
342
342
$ "WalkStatement(S->{ methodName } ()));") ;
343
343
else if ( typeName . Contains ( "Expr" ) )
344
- WriteLine ( $ "_S->{ fieldName } = static_cast<AST::{ typeName } >(" +
345
- $ "WalkExpression(S->{ methodName } ()));") ;
344
+ {
345
+ var expr = $ "_S->{ fieldName } = static_cast<AST::{ typeName } >(WalkExpression(S->{ methodName } ()));";
346
+
347
+ if ( fieldName == "base" && typeName is "CXXDependentScopeMemberExpr" )
348
+ {
349
+ // Clang asserts that 'getBase()' is not called when 'isImplicitAccess()' returns true
350
+ WriteLine ( "if (!S->isImplicitAccess())" ) ;
351
+ WriteLineIndent ( expr ) ;
352
+ }
353
+ else
354
+ {
355
+ WriteLine ( expr ) ;
356
+ }
357
+ }
346
358
else if ( fieldName == "guidDecl" )
347
359
WriteLine ( $ "_S->{ fieldName } = S->getGuidDecl()->getNameAsString();") ;
348
360
else if ( typeName . Contains ( "Decl" ) || typeName . Contains ( "Method" ) ||
Original file line number Diff line number Diff line change @@ -2426,7 +2426,8 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr)
2426
2426
_S->refersToMatrixElement = S->refersToMatrixElement ();
2427
2427
_S->hasPlaceholderType = S->hasPlaceholderType ();
2428
2428
_S->isImplicitAccess = S->isImplicitAccess ();
2429
- _S->base = static_cast <AST::Expr*>(WalkExpression (S->getBase ()));
2429
+ if (!S->isImplicitAccess ())
2430
+ _S->base = static_cast <AST::Expr*>(WalkExpression (S->getBase ()));
2430
2431
_S->baseType = GetQualifiedType (S->getBaseType ());
2431
2432
_S->isArrow = S->isArrow ();
2432
2433
_S->firstQualifierFoundInScope = static_cast <AST::Declaration*>(WalkDeclaration (S->getFirstQualifierFoundInScope ()));
You can’t perform that action at this time.
0 commit comments