[PATCH] Sema: Functions with dll attributes cannot be deleted
Nico Rieck
nico.rieck at gmail.com
Wed May 28 13:49:37 PDT 2014
On 28.05.2014 21:00, Hans Wennborg wrote:
> On Tue, May 27, 2014 at 7:53 PM, Nico Rieck <nico.rieck at gmail.com> wrote:
>>
>
> This sounds reasonable, but MSVC doesn't seem to diagnose it. It seems
> to happily compile the following:
>
> struct S {
> void __declspec(dllexport) foo() = delete;
> void __declspec(dllexport) bar() {}
> };
>
> exporting bar(), but not foo(). My (pretty old unfortunately) MinGW
> didn't error either.
IMO this is a missed diagnostic by the other compilers because deleting
non-member functions with dll attributes *is* diagnosed. Note that this
doesn't fire if the class itself has the attribute. But if folks feel
strongly about it I can exclude member functions.
> I think "cannot" diagnostics are more common in Clang. How about
> "cannot delete %q0 function".
I'll change it.
More information about the cfe-commits
mailing list