r308722 - Fixed failing assert in code completion.
Hans Wennborg via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 8 11:39:26 PDT 2017
Sorry for the slow reply; I missed this somehow.
Merged in r310395.
Thanks,
Hans
On Tue, Aug 8, 2017 at 5:20 AM, Alex L <arphaman at gmail.com> wrote:
> Ping?
>
> On 21 July 2017 at 10:44, Alex L <arphaman at gmail.com> wrote:
>>
>> Hans, can you please merge this to the LLVM 5.0 branch?
>>
>> AFAIK It's a recent regression that should get fixed in LLVM 5.0.
>>
>> Cheers,
>> Alex
>>
>>
>> On 21 July 2017 at 10:24, Ilya Biryukov via cfe-commits
>> <cfe-commits at lists.llvm.org> wrote:
>>>
>>> Author: ibiryukov
>>> Date: Fri Jul 21 02:24:00 2017
>>> New Revision: 308722
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=308722&view=rev
>>> Log:
>>> Fixed failing assert in code completion.
>>>
>>> Summary:
>>> The code was accessing uninstantiated default argument.
>>> This resulted in failing assertion at ParmVarDecl::getDefaultArg().
>>>
>>> Reviewers: erikjv, klimek, bkramer, krasimir
>>>
>>> Reviewed By: krasimir
>>>
>>> Subscribers: cfe-commits
>>>
>>> Differential Revision: https://reviews.llvm.org/D35682
>>>
>>> Added:
>>> cfe/trunk/test/CodeCompletion/uninstantiated_params.cpp
>>> Modified:
>>> cfe/trunk/lib/Sema/SemaCodeComplete.cpp
>>>
>>> Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=308722&r1=308721&r2=308722&view=diff
>>>
>>> ==============================================================================
>>> --- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
>>> +++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Fri Jul 21 02:24:00 2017
>>> @@ -2401,10 +2401,7 @@ formatBlockPlaceholder(const PrintingPol
>>> static std::string GetDefaultValueString(const ParmVarDecl *Param,
>>> const SourceManager &SM,
>>> const LangOptions &LangOpts) {
>>> - const Expr *defaultArg = Param->getDefaultArg();
>>> - if (!defaultArg)
>>> - return "";
>>> - const SourceRange SrcRange = defaultArg->getSourceRange();
>>> + const SourceRange SrcRange = Param->getDefaultArgRange();
>>> CharSourceRange CharSrcRange =
>>> CharSourceRange::getTokenRange(SrcRange);
>>> bool Invalid = CharSrcRange.isInvalid();
>>> if (Invalid)
>>>
>>> Added: cfe/trunk/test/CodeCompletion/uninstantiated_params.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeCompletion/uninstantiated_params.cpp?rev=308722&view=auto
>>>
>>> ==============================================================================
>>> --- cfe/trunk/test/CodeCompletion/uninstantiated_params.cpp (added)
>>> +++ cfe/trunk/test/CodeCompletion/uninstantiated_params.cpp Fri Jul 21
>>> 02:24:00 2017
>>> @@ -0,0 +1,13 @@
>>> +template <class T>
>>> +struct unique_ptr {
>>> + typedef T* pointer;
>>> +
>>> + void reset(pointer ptr = pointer());
>>> +};
>>> +
>>> +void test() {
>>> + unique_ptr<int> x;
>>> + x.
>>> + // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:5 %s -o - |
>>> FileCheck -check-prefix=CHECK-CC1 %s
>>> + // CHECK-CC1: [#void#]reset({#<#unique_ptr<int>::pointer ptr =
>>> pointer()#>#})
>>> +}
>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>>
>
More information about the cfe-commits
mailing list