[cfe-commits] r116289 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaCXX/expressions.cpp
John McCall
rjmccall at apple.com
Mon Oct 11 19:19:57 PDT 2010
Author: rjmccall
Date: Mon Oct 11 21:19:57 2010
New Revision: 116289
URL: http://llvm.org/viewvc/llvm-project?rev=116289&view=rev
Log:
I just do what the comments tell me to do.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaCXX/expressions.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=116289&r1=116288&r2=116289&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Oct 11 21:19:57 2010
@@ -6156,7 +6156,8 @@
// 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
Modified: cfe/trunk/test/SemaCXX/expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/expressions.cpp?rev=116289&r1=116288&r2=116289&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/expressions.cpp (original)
+++ cfe/trunk/test/SemaCXX/expressions.cpp Mon Oct 11 21:19:57 2010
@@ -14,3 +14,10 @@
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);
+}
More information about the cfe-commits
mailing list