[cfe-dev] Preliminary reinterpret_cast Sema patch
Doug Gregor
doug.gregor at gmail.com
Tue Oct 21 11:13:19 PDT 2008
On Tue, Oct 21, 2008 at 10:57 AM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On 10/21/08, Sebastian Redl <sebastian.redl at getdesigned.at> wrote:
>> By the way, I discovered that it emits a disambiguation warning on this
>> line:
>> int (&rar)[100] = const_cast<iarr>(ar);
>> This feels a bit wrong - how else would I define a reference to an array to
>> avoid the warning?
>
> Well, it *is* ambiguous, at least from the parser's perspective;
> consider if the int() were a cast and the & an addressof operator.
Sure, it's ambiguous, but we shouldn't warn about it because the code
isn't wrong (and isn't likely to be wrong).
- Doug
More information about the cfe-dev
mailing list