<div dir="ltr">Good catch! Fixed in r226633.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 5:24 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Jan 20, 2015 at 4:52 PM, David Majnemer<br>
<<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
> Author: majnemer<br>
> Date: Tue Jan 20 18:52:17 2015<br>
> New Revision: 226626<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=226626&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=226626&view=rev</a><br>
> Log:<br>
> Sema: err_after_alias is unreachable, remove it<br>
><br>
> Examples this would have catched are now handled by the attribute<br>
> verification code.<br>
><br>
> Modified:<br>
>     cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
>     cfe/trunk/lib/Sema/SemaDecl.cpp<br>
>     cfe/trunk/test/Sema/alias-redefinition.c<br>
><br>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=226626&r1=226625&r2=226626&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=226626&r1=226625&r2=226626&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br>
> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Jan 20 18:52:17 2015<br>
> @@ -3902,8 +3902,6 @@ def warn_missing_variable_declarations :<br>
>  def err_static_data_member_reinitialization :<br>
>    Error<"static data member %0 already has an initializer">;<br>
>  def err_redefinition : Error<"redefinition of %0">;<br>
> -def err_alias_after_tentative :<br>
> -  Error<"alias definition of %0 after tentative definition">;<br>
>  def err_alias_is_definition :<br>
>    Error<"definition %0 cannot also be an alias">;<br>
>  def err_definition_of_implicitly_declared_member : Error<<br>
><br>
> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=226626&r1=226625&r2=226626&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=226626&r1=226625&r2=226626&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)<br>
> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Jan 20 18:52:17 2015<br>
> @@ -2223,11 +2223,7 @@ static void checkNewAttributesAfterDef(S<br>
>          S.CheckForFunctionRedefinition(FD, cast<FunctionDecl>(Def));<br>
>        else {<br>
>          VarDecl *VD = cast<VarDecl>(New);<br>
> -        unsigned Diag = cast<VarDecl>(Def)->isThisDeclarationADefinition() ==<br>
> -                                VarDecl::TentativeDefinition<br>
> -                            ? diag::err_alias_after_tentative<br>
> -                            : diag::err_redefinition;<br>
> -        S.Diag(VD->getLocation(), Diag) << VD->getDeclName();<br>
> +        S.Diag(VD->getLocation(), diag::err_redefinition) << VD->getDeclName();<br>
>          S.Diag(Def->getLocation(), diag::note_previous_definition);<br>
>          VD->setInvalidDecl();<br>
>        }<br>
><br>
> Modified: cfe/trunk/test/Sema/alias-redefinition.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/alias-redefinition.c?rev=226626&r1=226625&r2=226626&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/alias-redefinition.c?rev=226626&r1=226625&r2=226626&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/Sema/alias-redefinition.c (original)<br>
> +++ cfe/trunk/test/Sema/alias-redefinition.c Tue Jan 20 18:52:17 2015<br>
> @@ -28,3 +28,7 @@ static int var2 __attribute((alias("v2")<br>
><br>
>  extern int var3 __attribute__((alias("C"))); // expected-note{{previous definition is here}}<br>
>  int var3 = 3; // expected-error{{redefinition of 'var3'}}<br>
> +<br>
> +int v4;<br>
> +int var4;<br>
> +int var4 __attribute((alias("v4"))); // expected-error {{definition 'var4' cannot also be an alias}}<br>
<br>
</div></div>What about:<br>
<br>
  int var4;<br>
  extern int var4 __attribute__((alias("v4")));<br>
<br>
?<br>
</blockquote></div><br></div>