[PATCH] D10805: Disabling of "redefine_extname" pragma for C++ code

Andrey Bokhanko andreybokhanko at gmail.com
Thu Jul 16 08:45:29 PDT 2015


On Thu, Jul 16, 2015 at 2:58 PM, Aaron Ballman <aaron.ballman at gmail.com> wrote:
> LGTM with one minor nit:
>
>> Index: lib/Sema/SemaDecl.cpp
>> ===================================================================
>> --- lib/Sema/SemaDecl.cpp
>> +++ lib/Sema/SemaDecl.cpp
>> @@ -5561,15 +5561,12 @@
>>    return true;
>>  }
>>
>> -/// \brief Returns true if given declaration is TU-scoped and externally
>> -/// visible.
>> -static bool isDeclTUScopedExternallyVisible(const Decl *D) {
>> +/// \brief Returns true if given declaration has external C language linkage.
>> +static bool isDeclExternC(const Decl *D) {
>>    if (auto *FD = dyn_cast<FunctionDecl>(D))
>> -    return (FD->getDeclContext()->isTranslationUnit() || FD->isExternC()) &&
>> -           FD->hasExternalFormalLinkage();
>> -  else if (auto *VD = dyn_cast<VarDecl>(D))
>> -    return (VD->getDeclContext()->isTranslationUnit() || VD->isExternC()) &&
>> -           VD->hasExternalFormalLinkage();
>> +    return FD->isExternC();
>> +  if (auto *VD = dyn_cast<VarDecl>(D))
>
> const auto *

Fixed. Patch updated.

Aaron, thank you for the review!

Alexey [Bataev] / Aaron, I don't have commit access yet; could you,
please, commit this patch on my behalf?

Yours,
Andrey



More information about the cfe-commits mailing list