[patch] Misc fixes to our handling of language linkage.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Feb 11 18:40:04 PST 2013


> +/// \brief Describes the different kinds of language linkage
> +/// (C++ [dcl.link]) that an entity may have.
> +enum LanguageLinkage {
> +  CLanguageLinkage,
> +  CXXLanguageLinkage,
> +  NoLanguageLinkage
> +};
>
> Is there a reason to keep this separate from LinkageSpecDecl::LanguageIDs?

That has only c and c++. Do you think it makes sense to add a lang_none?


> +// This is OK. Both test2_f don't have language linkage since they have
> +// internal linkage.
>  extern "C" {
> -  static void test2_f() { // expected-note {{previous definition is here}}
> +  static void test2_f() {
>    }
> -  static void test2_f(int x) { // expected-error {{conflicting types for
> 'test2_f'}}
> +  static void test2_f(int x) {
>    }
>  }
>
> Please add a CodeGen test to ensure that we give these two functions
> different mangled names.
>

Good catch, we were producing code for just one of the functions.
Updated patch attached.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 12874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130211/117c22e7/attachment.obj>


More information about the cfe-commits mailing list