forked from OSchip/llvm-project
Don't capture DeclRefExpr::getNameInfo().getInfo(). It returns reference in temporary object.
DeclarationNameInfo::getInfo() returns reference, but DeclRefExpr::getNameInfo() returns temporary DeclarationNameInfo(). It triggered a local crash for me. Failing Tests (1): Clang :: SemaTemplate/instantiate-overload-candidates.cpp Assertion failed! Program: bin\clang.EXE File: clang/lib/Basic/SourceManager.cpp, Line 822 Expression: 0 && "Invalid SLocOffset or bad function choice" llvm-svn: 220841
This commit is contained in:
parent
815d752b93
commit
44d4d9a4cb
|
@ -10460,7 +10460,7 @@ TreeTransform<Derived>::RebuildCXXOperatorCallExpr(OverloadedOperatorKind Op,
|
||||||
SourceLocation RBrace;
|
SourceLocation RBrace;
|
||||||
|
|
||||||
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Callee)) {
|
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Callee)) {
|
||||||
DeclarationNameLoc &NameLoc = DRE->getNameInfo().getInfo();
|
DeclarationNameLoc NameLoc = DRE->getNameInfo().getInfo();
|
||||||
LBrace = SourceLocation::getFromRawEncoding(
|
LBrace = SourceLocation::getFromRawEncoding(
|
||||||
NameLoc.CXXOperatorName.BeginOpNameLoc);
|
NameLoc.CXXOperatorName.BeginOpNameLoc);
|
||||||
RBrace = SourceLocation::getFromRawEncoding(
|
RBrace = SourceLocation::getFromRawEncoding(
|
||||||
|
|
Loading…
Reference in New Issue