[cfe-commits] r81309 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/static-array-member.cpp
Douglas Gregor
dgregor at apple.com
Tue Sep 8 23:06:29 PDT 2009
On Sep 8, 2009, at 6:50 PM, Eli Friedman wrote:
> On Tue, Sep 8, 2009 at 6:45 PM, Douglas Gregor<dgregor at apple.com>
> wrote:
>> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
>> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Sep 8 20:45:28 2009
>> @@ -980,6 +980,13 @@
>> if (getLangOptions().CPlusPlus) {
>> if (Context.hasSameType(New->getType(), Old->getType()))
>> MergedT = New->getType();
>> + // C++ [basic.types]p7:
>> + // [...] The declared type of an array object might be an
>> array of
>> + // unknown size and therefore be incomplete at one point in a
>> + // translation unit and complete later on; [...]
>> + else if (Old->getType()->isIncompleteArrayType() &&
>> + New->getType()->isArrayType())
>> + MergedT = New->getType();
>> } else {
>> MergedT = Context.mergeTypes(New->getType(), Old->getType());
>> }
>
> Do you need to check that the element types are the same?
Err... yes... fixed in r81317. Thanks.
- Doug
More information about the cfe-commits
mailing list