Make sure to diagnose use of declarations in the case where we create an implicit CXXThisExpr.
llvm-svn: 78474
This commit is contained in:
parent
d3a114fe2d
commit
21776b75ce
|
@ -1139,6 +1139,8 @@ Sema::BuildDeclarationNameExpr(SourceLocation Loc, NamedDecl *D,
|
|||
MarkDeclarationReferenced(Loc, D);
|
||||
if (PerformObjectMemberConversion(This, D))
|
||||
return ExprError();
|
||||
if (DiagnoseUseOfDecl(D, Loc))
|
||||
return ExprError();
|
||||
return Owned(new (Context) MemberExpr(This, true, D,
|
||||
Loc, MemberType));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
// RUN: clang-cc %s -verify -fsyntax-only
|
||||
class A {
|
||||
void f() __attribute__((deprecated));
|
||||
void g(A* a);
|
||||
|
||||
int b __attribute__((deprecated));
|
||||
};
|
||||
|
||||
void A::g(A* a)
|
||||
{
|
||||
f(); // expected-warning{{'f' is deprecated}}
|
||||
a->f(); // expected-warning{{'f' is deprecated}}
|
||||
|
||||
(void)b; // expected-warning{{'b' is deprecated}}
|
||||
(void)a->b; // expected-warning{{'b' is deprecated}}
|
||||
}
|
Loading…
Reference in New Issue