[cfe-commits] [patch] Avoid redundant error when redefining a function as deleted
David Blaikie
dblaikie at gmail.com
Fri Jun 29 11:02:25 PDT 2012
On Fri, Jun 29, 2012 at 10:56 AM, Douglas Gregor <dgregor at apple.com> wrote:
>
> On Jun 27, 2012, at 11:10 AM, David Blaikie <dblaikie at gmail.com> wrote:
>
>> void func() {}
>> void func() = delete;
>>
>> currently produces two errors in Clang - the first says that you are
>> redefining func, the second says that a deleted definition must be the
>> first declaration.
>>
>> This patch suppresses the latter when the function is already defined
>> (& we will have already produced the former). If we want to produce a
>> better diagnostic we'd have to plumb through more information from the
>> parser to sema when we encounter a definition - currently the first
>> error is produced by sema but without any knowledge about what kind of
>> definition we are seeing so we can't customize the diagnostic to
>> explain the specific issue.
>
>
> This LGTM.
Thanks Doug,
Committed as r159442.
- David
More information about the cfe-commits
mailing list