forked from OSchip/llvm-project
A few small cleanups to r187504. Thanks to dblaikie for the assist.
llvm-svn: 187521
This commit is contained in:
parent
9a9aa228a8
commit
957c8b1c70
|
@ -5102,14 +5102,13 @@ Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base, SourceLocation OpLoc,
|
|||
<< 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();
|
||||
|
|
|
@ -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 '.'?}}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue