[PATCH] D11297: PR17829: Functions declared extern "C" with a name matching a mangled C++ function are allowed

John McCall rjmccall at gmail.com
Thu Jul 23 23:40:36 PDT 2015


rjmccall added a comment.

I disagree with the conclusions in that thread (and wish you had CC'ed me; I unfortunately do not have time to keep up with cfe-dev).  There is roughly zero chance that somebody is declaring an extern "C" symbol with a name that matches an Itanium mangled name with any intent other than to name that entity.  We should not be rejecting this code or silently renaming one of the symbols.  We should, of course, still diagnose attempts to *define* the same symbol multiple times.

The correct fix is to add bitcasts and/or replace globals as necessary so that the colliding references name the same LLVM object.  We already have a type, it should be easy to bitcast to that.


http://reviews.llvm.org/D11297







More information about the cfe-commits mailing list