I just do what the comments tell me to do.

llvm-svn: 116289
This commit is contained in:
John McCall 2010-10-12 02:19:57 +00:00
parent 18d853794f
commit 01cbf2de0f
2 changed files with 9 additions and 1 deletions

View File

@ -6156,7 +6156,8 @@ QualType Sema::CheckAssignmentOperands(Expr *LHS, Expr *&RHS,
// is converted to the type of the assignment expression (above).
// C++ 5.17p1: the type of the assignment expression is that of its left
// operand.
return LHSType.getUnqualifiedType();
return (getLangOptions().CPlusPlus
? LHSType : LHSType.getUnqualifiedType());
}
// C99 6.5.17

View File

@ -14,3 +14,10 @@ void f0() {
register int x;
f0_1(&x);
}
template <class T> void bar(T &x) { T::fail(); }
template <class T> void bar(volatile T &x) {}
void f1() {
volatile int x;
bar(x = 5);
}