[PATCH] Sema: Check dll attributes on redeclarations

Reid Kleckner rnk at google.com
Sun Mar 30 11:12:43 PDT 2014


On Sun, Mar 30, 2014 at 11:05 AM, Nico Rieck <nico.rieck at gmail.com> wrote:

> On 30.03.2014 19:35, Reid Kleckner wrote:
> > Should we be more specific here?  Something like:
> > redeclaration %0 adds attribute %1 which was missing the previous
> > declaration
>
> Sounds like a good idea. I would phrase it: "redeclaration of %q0 may
> not add %q1 attribute" (or rather "cannot"?) which would look like:
>
> t.cpp:222:28: error: redeclaration of 'X::f' may not add 'dllexport'
> attribute
> __declspec(dllexport) void X::f() {}
>                               ^
> t.cpp:219:6: note: previous declaration is here
>   void f();
>

I like your wording better.  I'd go with "cannot".  DiagnosticSemaKinds.td
has 28 "may not" instances and ~370 "cannot" instances.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140330/dd63e448/attachment.html>


More information about the cfe-commits mailing list