aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/DeclPrinter.cpp6
-rw-r--r--lib/Sema/SemaExpr.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index 5394924797..609d64cc7e 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -214,7 +214,11 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) {
if (PrintAccess) {
AccessSpecifier AS = D->getAccess();
- if (AS != CurAS) {
+ // This is a hack: when a struct is declared in a member declaration
+ // struct outer { struct inner *ptr; }; then we encounter the struct
+ // decl, but it has no access specifier.
+ // The correct solution is to merge this with the member.
+ if (AS != CurAS && AS != AS_none) {
if (Indent)
this->Indent(Indentation - Policy.Indentation);
Print(AS);
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 56288eaa46..3ac4d133fe 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2670,7 +2670,7 @@ Sema::BuildMemberReferenceExpr(ExprArg BaseArg, QualType BaseType,
return move(Result);
}
- return BuildMemberReferenceExpr(ExprArg(*this, Base), Base->getType(),
+ return BuildMemberReferenceExpr(ExprArg(*this, Base), BaseType,
OpLoc, IsArrow, SS, FirstQualifierInScope,
R, TemplateArgs);
}