r187521 - A few small cleanups to r187504. Thanks to dblaikie for the assist.

Kaelyn Uhrain rikka at google.com
Wed Jul 31 13:16:18 PDT 2013


Author: rikka
Date: Wed Jul 31 15:16:17 2013
New Revision: 187521

URL: http://llvm.org/viewvc/llvm-project?rev=187521&view=rev
Log:
A few small cleanups to r187504. Thanks to dblaikie for the assist.

Modified:
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/test/FixIt/fixit.cpp
    cfe/trunk/test/SemaCXX/member-expr.cpp

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=187521&r1=187520&r2=187521&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Jul 31 15:16:17 2013
@@ -5102,14 +5102,13 @@ Sema::ActOnStartCXXMemberReference(Scope
               << FixItHint::CreateReplacement(OpLoc, ".");
             OpKind = tok::period;
             break;
-          } else {
-            Diag(OpLoc, diag::err_typecheck_member_reference_arrow)
-              << BaseType << Base->getSourceRange();
-            CallExpr *CE = dyn_cast<CallExpr>(Base);
-            if (Decl *CD = (CE ? CE->getCalleeDecl() : 0)) {
-              Diag(CD->getLocStart(),
-                   diag::note_member_reference_arrow_from_operator_arrow);
-            }
+          }
+          Diag(OpLoc, diag::err_typecheck_member_reference_arrow)
+            << BaseType << Base->getSourceRange();
+          CallExpr *CE = dyn_cast<CallExpr>(Base);
+          if (Decl *CD = (CE ? CE->getCalleeDecl() : 0)) {
+            Diag(CD->getLocStart(),
+                 diag::note_member_reference_arrow_from_operator_arrow);
           }
         }
         return ExprError();

Modified: cfe/trunk/test/FixIt/fixit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/fixit.cpp?rev=187521&r1=187520&r2=187521&view=diff
==============================================================================
--- cfe/trunk/test/FixIt/fixit.cpp (original)
+++ cfe/trunk/test/FixIt/fixit.cpp Wed Jul 31 15:16:17 2013
@@ -326,3 +326,15 @@ namespace PR5898 {
     return foo->(x) == y;  // expected-error {{unexpected '->' in function call; perhaps remove the '->'?}}
   }
 }
+
+namespace PR15045 {
+  class Cl0 {
+  public:
+    int a;
+  };
+
+  int f() {
+    Cl0 c;
+    return c->a;  // expected-error {{member reference type 'PR15045::Cl0' is not a pointer; maybe you meant to use '.'?}}
+  }
+}

Modified: cfe/trunk/test/SemaCXX/member-expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/member-expr.cpp?rev=187521&r1=187520&r2=187521&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/member-expr.cpp (original)
+++ cfe/trunk/test/SemaCXX/member-expr.cpp Wed Jul 31 15:16:17 2013
@@ -79,9 +79,11 @@ namespace test5 {
   };
 
   void test0(int x) {
+    x.A::foo<int>(); // expected-error {{'int' is not a structure or union}}
   }
 
   void test1(A *x) {
+    x.A::foo<int>(); // expected-error {{'test5::A *' is a pointer}}
   }
 
   void test2(A &x) {





More information about the cfe-commits mailing list