[cfe-commits] r146371 - in /cfe/trunk: include/clang/Basic/DiagnosticASTKinds.td lib/AST/ExprConstant.cpp test/SemaCXX/constant-expression-cxx11.cpp

Richard Smith richard at metafoo.co.uk
Mon Dec 12 11:36:50 PST 2011


On Mon, December 12, 2011 12:59, Chandler Carruth wrote:
> On Mon, Dec 12, 2011 at 4:46 AM, Richard Smith
> <richard-llvm at metafoo.co.uk>wrote:
>> +def note_constexpr_invalid_cast : Note<
>> +  "%select{reinterpret_cast|dynamic_cast|reinterpreting cast}0 not
>> allowed " +  "in a constant expression">;
>
> What is a "reinterpreting cast"? The fact that it isn't a reinterpret_cast
> is ... highly confusing. Is there any better way to phrase this?

The standard is highly confusing here too, and just says "a reinterpret_cast"
when it means "a reinterpret_cast or a cast which performs the conversions of
a reinterpret_cast". I've reworded the diagnostic for the latter case as "cast
which performs the conversions of a reinterpret_cast is not allowed in a
constant expression". I think that's much better, but I'm still not completely
happy with this wording -- suggestions would be greatly appreciated.

> Also, "is not allowed" would read buch better to me....

Done. r146395 + r146406.

- Richard




More information about the cfe-commits mailing list