r212154 - Introduce a FunctionDecl::getReturnTypeSourceRange() utility
David Blaikie
dblaikie at gmail.com
Wed Jul 2 08:05:13 PDT 2014
On Tue, Jul 1, 2014 at 11:39 PM, Alp Toker <alp at nuanti.com> wrote:
>
> On 02/07/2014 09:24, Tobias Grosser wrote:
>>
>> On 02/07/2014 03:47, Alp Toker wrote:
>>>
>>> Author: alp
>>> Date: Tue Jul 1 20:47:15 2014
>>> New Revision: 212154
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=212154&view=rev
>>> Log:
>>> Introduce a FunctionDecl::getReturnTypeSourceRange() utility
>>>
>>> This source range is useful for all kinds of diagnostic QOI and
>>> refactoring
>>> work, so let's make it more discoverable.
>>>
>>> This commit also makes use of the new function to enhance various
>>> diagnostics
>>> relating to return types and resolves an old FIXME.
>>>
>>> Modified:
>>> cfe/trunk/include/clang/AST/Decl.h
>>> cfe/trunk/lib/AST/Decl.cpp
>>> cfe/trunk/lib/Sema/SemaDecl.cpp
>>> cfe/trunk/lib/Sema/SemaDeclCXX.cpp
>>
>>
>> This does not affect any test cases? No test case that could be added?
>
>
> It just moved an existing function and added source informative source
> locations which we don't usually test.
>
> We probably *should* test the locations though, there are problems with type
> locations stored in the AST that need fixing, so will look into it.
Yeah, we're a bit ad-hoc about testing actual source locations, but we
do have some tests for them when they're interesting/relevant/someone
gets around to it.
I think they use the machine readable output format (I forget the name
of the flag, but if you find the flag name and search the test
directories I'm sure you'll find them).
- David
More information about the cfe-commits
mailing list