[cfe-dev] Visiting implicit copy assignment

Peter Stirling peter at pjstirling.plus.com
Fri Apr 17 16:43:50 PDT 2015


This is something that would also be useful for my clang tool (and I was 
planning to send an email to the list on it next week!).

Something like std::vector<Decl*> getImplicitDecls() would be very 
handy, without polluting the AST in a way that would confuse things that 
only care about what was in the source?

On 17/04/15 20:58, Kim Gräsman wrote:
> Hi all,
>
> I'm experimenting with a Clang tool to generate export tables from
> source code (MSVC's .DEF files)
>
> I've noticed that MSVC always exports the copy assignment operator if
> the class is marked __declspec(dllexport), so I'm trying to mimic that
> behavior.
>
> So, given:
>
>    class Implicits { };
>
> Can I somehow visit the implicit methods (default ctor, copy ctor,
> copy assignment operator, dtor) in a Clang tool?
>
> I've smuggled Sema into the tool and tried to use the DefineImplicit
> methods to define them before visitation, but haven't had much luck.
>
> Is there a documented way to handle this? It seems Clang only defines
> these methods if they are used, but for tooling it would be useful to
> be able to work with them whether they're actually defined or not.
>
> Thanks,
> - Kim
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com





More information about the cfe-dev mailing list