[cfe-commits] r70634 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExpr.cpp test/SemaCXX/offsetof.cpp

Douglas Gregor dgregor at apple.com
Sat May 2 19:48:05 PDT 2009


On May 2, 2009, at 5:03 PM, Eli Friedman wrote:

> On Sat, May 2, 2009 at 3:51 PM, Anders Carlsson <andersca at mac.com>  
> wrote:
>>
>> 2 maj 2009 kl. 12.10 skrev Chris Lattner:
>>
>>> On May 2, 2009, at 10:45 AM, Anders Carlsson wrote:
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=70634&view=rev
>>>> Log:
>>>> Downgrade the invalid offsetof error to a warning.
>>>
>>> Should the warning default to error?
>>>
>>
>> gcc 4.2 warns by default. Eli, what do you think?
>
> It'd be nice if we could detect the case where the struct isn't a POD
> only because it has a non-trivial constructor/destructor.

The C++0x notion of a "standard layout type" is probably what we would  
want here, and we'll have to support it eventually.

> We could
> then make that an extension warning (possibly off by default), and
> make the other cases errors by default.


In C++98, making it an extension warning for standard layout types  
would make sense.

	- Doug



More information about the cfe-commits mailing list