On Tue, Sep 23, 2014 at 2:33 PM, Michael Park <[email protected]> wrote:

> I tried adding *LocalInstantiationScope* around
> *PerformPendingInstantiation*, like so:
>
> // A static constexpr member function of a local class can be used in
>> // a constexpr expression right after the local class' definition.
>> // We need to instantiate them now, otherwise it may be too late.
>> LocalInstantiationScope Local(SemaRef);
>> SemaRef.PerformPendingInstantiations(/*LocalOnly=*/true);
>> Local.Exit();
>
>
> but it didn't seem to work. I'm not sure what I'm missing here. Could you
> give me a hint please?
>

This is the bit I was referring to:

  SavePendingLocalImplicitInstantiationsRAII
      SavedPendingLocalImplicitInstantiations(*this);
  std::unique_ptr<SavePendingInstantiationsAndVTableUsesRAII>
      SavePendingInstantiationsAndVTableUses;
  if (Recursive) {
    SavePendingInstantiationsAndVTableUses.reset(
        new SavePendingInstantiationsAndVTableUsesRAII(*this));
  }

[...]

  PerformPendingInstantiations(/*LocalOnly=*/true);
  Scope.Exit();

  if (Recursive) {
    // Define any pending vtables.
    DefineUsedVTables();

    // Instantiate any pending implicit instantiations found during the
    // instantiation of this template.
    PerformPendingInstantiations();

    // Restore PendingInstantiations and VTableUses.
    SavePendingInstantiationsAndVTableUses.reset();
  }



> Thanks
>
> On 25 August 2014 01:30, Richard Smith <[email protected]> wrote:
>
>> It would be better to save and restore the pending local instantiations
>> around the calls to instantiate the class body and its members, as we do
>> elsewhere when we perform local pending instantiations.
>>
>>
>> On Fri, Aug 22, 2014 at 2:41 AM, Michael Park <[email protected]> wrote:
>>
>>> Fixes http://llvm.org/bugs/show_bug.cgi?id=20625
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> [email protected]
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>
>>>
>>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to