On 25.02.2012, at 01:12, Douglas Gregor <[email protected]> wrote: > Author: dgregor > Date: Fri Feb 24 18:06:47 2012 > New Revision: 151412 > > URL: http://llvm.org/viewvc/llvm-project?rev=151412&view=rev > Log: > Simplify check per Eli's comment > > Modified: > cfe/trunk/lib/CodeGen/CodeGenTypes.cpp > > Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=151412&r1=151411&r2=151412&view=diff > ============================================================================== > --- cfe/trunk/lib/CodeGen/CodeGenTypes.cpp (original) > +++ cfe/trunk/lib/CodeGen/CodeGenTypes.cpp Fri Feb 24 18:06:47 2012 > @@ -201,11 +201,8 @@ > // convert it. Note that getDefinition()==0 is not the same as > !isDefinition. > // The exception is an enumeration type with a fixed underlying type; these > // can be converted even if they are forward declarations. > - if (TT->getDecl()->getDefinition() == 0 && > - !(isa<EnumDecl>(TT->getDecl()) && > - cast<EnumDecl>(TT->getDecl())->isFixed())) { > + if (TT->isIncompleteType()) > return false; > - }
Comment needs an update now. - Ben > > // If this is an enum, then it is always safe to convert. > const RecordType *RT = dyn_cast<RecordType>(TT); > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
