Index: lib/Sema/SemaExprMember.cpp =================================================================== --- lib/Sema/SemaExprMember.cpp +++ lib/Sema/SemaExprMember.cpp @@ -848,7 +848,7 @@ // Build the first member access in the chain with full information. result = BuildFieldReferenceExpr(result, baseObjectIsPointer, SourceLocation(), - EmptySS, field, foundDecl, memberNameInfo) + SS, field, foundDecl, memberNameInfo) .get(); if (!result) return ExprError(); Index: test/SemaCXX/PR35832.cpp =================================================================== --- test/SemaCXX/PR35832.cpp +++ test/SemaCXX/PR35832.cpp @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// expected-no-diagnostics + +class B { +public: + int i; + struct { struct { union { int j; }; }; }; +}; + +class X : public B { }; +class Y : public B { }; + +class Z : public X, Y { +public: + int a() { return X::i; } + int b() { return X::j; } + int c() { return this->X::j; } +};