AST: Remove overzealous assertion from IsModifiable
It's reasonable to ask if an l-value with class type is modifiable. llvm-svn: 225121
This commit is contained in:
parent
ddd926441e
commit
99b98f07d4
|
@ -615,14 +615,9 @@ static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E,
|
|||
return Cl::CM_IncompleteType;
|
||||
|
||||
// Records with any const fields (recursively) are not modifiable.
|
||||
if (const RecordType *R = CT->getAs<RecordType>()) {
|
||||
assert((E->getObjectKind() == OK_ObjCProperty ||
|
||||
!Ctx.getLangOpts().CPlusPlus) &&
|
||||
"C++ struct assignment should be resolved by the "
|
||||
"copy assignment operator.");
|
||||
if (const RecordType *R = CT->getAs<RecordType>())
|
||||
if (R->hasConstFields())
|
||||
return Cl::CM_ConstQualified;
|
||||
}
|
||||
|
||||
return Cl::CM_Modifiable;
|
||||
}
|
||||
|
|
|
@ -34,3 +34,6 @@ void test5() {
|
|||
char buf[1];
|
||||
__asm__ ("":"+r" (buf));
|
||||
}
|
||||
|
||||
struct MMX_t {};
|
||||
void test6() { __asm__("" : "=m"(*(MMX_t *)0)); }
|
||||
|
|
Loading…
Reference in New Issue