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:
David Majnemer 2015-01-04 00:44:32 +00:00
parent ddd926441e
commit 99b98f07d4
2 changed files with 4 additions and 6 deletions

View File

@ -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;
}

View File

@ -34,3 +34,6 @@ void test5() {
char buf[1];
__asm__ ("":"+r" (buf));
}
struct MMX_t {};
void test6() { __asm__("" : "=m"(*(MMX_t *)0)); }