mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 12:15:46 +00:00
UnresolvedMemberExprs need lvalue-to-rvalue conversions during template
instantiations too. llvm-svn: 143016
This commit is contained in:
parent
82f4cf46aa
commit
3d5c1fa93f
@ -2145,6 +2145,13 @@ public:
|
||||
CXXScopeSpec SS;
|
||||
SS.Adopt(QualifierLoc);
|
||||
|
||||
if (BaseE && IsArrow) {
|
||||
ExprResult BaseResult = getSema().DefaultLvalueConversion(BaseE);
|
||||
if (BaseResult.isInvalid())
|
||||
return ExprError();
|
||||
BaseE = BaseResult.take();
|
||||
}
|
||||
|
||||
return SemaRef.BuildMemberReferenceExpr(BaseE, BaseType,
|
||||
OperatorLoc, IsArrow,
|
||||
SS, FirstQualifierInScope,
|
||||
|
@ -1533,4 +1533,19 @@ namespace template_member_test {
|
||||
|
||||
template struct IndirectLock<int>; // expected-note {{here}}
|
||||
|
||||
struct V {
|
||||
void f(int);
|
||||
void f(double);
|
||||
|
||||
Mutex m;
|
||||
V *p GUARDED_BY(this->m);
|
||||
};
|
||||
template<typename U> struct W {
|
||||
V v;
|
||||
void f(U u) {
|
||||
v.p->f(u); // expected-warning {{reading variable 'p' requires locking 'm'}}
|
||||
}
|
||||
};
|
||||
template struct W<int>; // expected-note {{here}}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user