]> granicus.if.org Git - clang/commit
[coroutines] Fix invalid source range in co_await call expressions.
authorEric Fiselier <eric@efcs.ca>
Tue, 27 Mar 2018 03:15:46 +0000 (03:15 +0000)
committerEric Fiselier <eric@efcs.ca>
Tue, 27 Mar 2018 03:15:46 +0000 (03:15 +0000)
commit41f066c74f234c1144f25ad1837a03c238c6de20
tree3c12e2861f25c22d3e44e1da0260584d3ab43668
parent89a447876085951d814759cddcb744614e5b4499
[coroutines] Fix invalid source range in co_await call expressions.

Summary:
Currently an invalid source range is generated for the member call expressions of `co_await`. The end location of the call expression is the `co_await` token loc, while the start is the location of the operand. This causes crashes when the source range is used to produce diagnostics.

This patch fixes the issues by using the expression location instead of the token location when building the member calls.

Reviewers: GorNishanov, rsmith, vsk, aaron.ballman

Reviewed By: vsk

Subscribers: cfe-commits, modocache

Differential Revision: https://reviews.llvm.org/D44915

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328606 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaCoroutine.cpp
test/SemaCXX/coroutine-source-location-crash.cpp [new file with mode: 0644]