Skip to content
Snippets Groups Projects
Commit 16834e88 authored by Douglas Gregor's avatar Douglas Gregor
Browse files

Only provide a source location for an anonymous tag if the location is valid

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105010 91177308-0d34-0410-b5e6-96231b3b80d8
parent ea2f41c5
No related branches found
No related tags found
No related merge requests found
...@@ -452,11 +452,13 @@ void TypePrinter::PrintTag(TagDecl *D, std::string &InnerString) { ...@@ -452,11 +452,13 @@ void TypePrinter::PrintTag(TagDecl *D, std::string &InnerString) {
if (!HasKindDecoration) if (!HasKindDecoration)
OS << " " << D->getKindName(); OS << " " << D->getKindName();
PresumedLoc PLoc = D->getASTContext().getSourceManager().getPresumedLoc( if (D->getLocation().isValid()) {
D->getLocation()); PresumedLoc PLoc = D->getASTContext().getSourceManager().getPresumedLoc(
OS << " at " << PLoc.getFilename() D->getLocation());
<< ':' << PLoc.getLine() OS << " at " << PLoc.getFilename()
<< ':' << PLoc.getColumn(); << ':' << PLoc.getLine()
<< ':' << PLoc.getColumn();
}
} }
OS << '>'; OS << '>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment