[cfe-dev] Ensure name doesn't already exist

Manuel Klimek klimek at google.com
Thu Jul 3 06:02:37 PDT 2014


On Tue, Jul 1, 2014 at 9:11 PM, Daniel Dilts <diltsman at gmail.com> wrote:

> I am possibly renaming a class.  I would like to make sure that the new
> name doesn't already exist.  Given that I am generating the new name, I
> have it in a std::string.
>
> How would I check to see if there is already something with the new name
> in the DeclContext?  I assume I would use DeclContext::lockup of some
> flavor.  Also, the new name does not specify any namespaces (no :: anywhere
> in it).
>

Unfortunately that's basically impossible in C++ (argument dependent lookup
etc). But the easy cases should be handled by doing DeclContext::lookup
throught all parent contexts.


>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140703/d735cc43/attachment.html>


More information about the cfe-dev mailing list