[cfe-commits] r103248 - in /cfe/trunk/lib: AST/DeclPrinter.cpp Sema/SemaExpr.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Fri May 7 02:09:23 PDT 2010


Author: cornedbee
Date: Fri May  7 04:09:23 2010
New Revision: 103248

URL: http://llvm.org/viewvc/llvm-project?rev=103248&view=rev
Log:
Revert 103247, it causes lots of test failures.

Modified:
    cfe/trunk/lib/AST/DeclPrinter.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=103248&r1=103247&r2=103248&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Fri May  7 04:09:23 2010
@@ -214,7 +214,11 @@
     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);

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=103248&r1=103247&r2=103248&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri May  7 04:09:23 2010
@@ -2670,7 +2670,7 @@
       return move(Result);
   }
 
-  return BuildMemberReferenceExpr(ExprArg(*this, Base), Base->getType(),
+  return BuildMemberReferenceExpr(ExprArg(*this, Base), BaseType,
                                   OpLoc, IsArrow, SS, FirstQualifierInScope,
                                   R, TemplateArgs);
 }





More information about the cfe-commits mailing list