diff options
author | Erik Verbruggen <erikjv@me.com> | 2012-12-25 14:51:39 +0000 |
---|---|---|
committer | Erik Verbruggen <erikjv@me.com> | 2012-12-25 14:51:39 +0000 |
commit | 65d78312ce026092cb6e7b1d4d06f05e18d02aa0 (patch) | |
tree | 165233da9770e9d2bf6b5d46af36b1303d7db11d /lib/Sema/SemaInit.cpp | |
parent | 38980086c0f791e8c23cc882574f18e5b4a87db6 (diff) |
Fix for PR12222.
Changed getLocStart() and getLocEnd() to be required for Stmts, and make
getSourceRange() optional. The default implementation for getSourceRange()
is build the range by calling getLocStart() and getLocEnd().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index a40bf9fd8e..2dbefdbc3b 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -1632,8 +1632,8 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, StructuredList = IsFirstDesignator? SyntacticToSemantic.lookup(IList) : getStructuredSubobjectInit(IList, Index, CurrentObjectType, StructuredList, StructuredIndex, - SourceRange(D->getStartLocation(), - DIE->getSourceRange().getEnd())); + SourceRange(D->getLocStart(), + DIE->getLocEnd())); assert(StructuredList && "Expected a structured initializer list"); } @@ -1801,10 +1801,10 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, if (!VerifyOnly) { DesignatedInitExpr::Designator *NextD = DIE->getDesignator(DesigIdx + 1); - SemaRef.Diag(NextD->getStartLocation(), + SemaRef.Diag(NextD->getLocStart(), diag::err_designator_into_flexible_array_member) - << SourceRange(NextD->getStartLocation(), - DIE->getSourceRange().getEnd()); + << SourceRange(NextD->getLocStart(), + DIE->getLocEnd()); SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) << *Field; } |