[cfe-dev] How to deal with mangled names matching with extern "C" ones?

Reid Kleckner rnk at google.com
Tue Jul 7 08:18:49 PDT 2015


I think we should just fix the assert by erroring out from CodeGen when it
detects that two Decls have the same mangled name. This might be tricky
because we usually assume that decls have a unique mangled name.

If people want to compile C++ transpiled to C, I don't see why clang should
forbid that. The Itanium ABI restricts itself to valid C identifiers to
support this exact use case.

On Tue, Jul 7, 2015 at 7:44 AM, Andrey Bokhanko <andreybokhanko at gmail.com>
wrote:

> Hmmm, maybe we should just check that identifiers don't start with
> _[A-Z] and print an error if they are?
>
> Richard [Smith], what do you think?
>
> Yours,
> Andrey
>
>
> On Tue, Jul 7, 2015 at 2:39 PM, Renato Golin <renato.golin at linaro.org>
> wrote:
> > On 7 July 2015 at 12:20, Stephan Bergmann <sbergman at redhat.com> wrote:
> >> [lex.name]/3.1: "Each identifier that contains a double underscore __
> or
> >> begins with an underscore followed by an
> >> uppercase letter is reserved to the implementation for any use."
> >
> > Right, I always forget the _[A-Z] case. I guess how we deal with this
> > is up to interpretation.
> >
> > cheers,
> > --renato
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> _______________________________________________
> 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/20150707/851f17bd/attachment.html>


More information about the cfe-dev mailing list