@@ -185,6 +185,12 @@ lvalue_kind (const_tree ref)
op2_lvalue_kind = lvalue_kind (TREE_OPERAND (ref, 2));
break;
+ case MODOP_EXPR:
+ /* We expect to see unlowered MODOP_EXPRs only during
+ template processing. */
+ gcc_assert (processing_template_decl);
+ return clk_ordinary;
+
case MODIFY_EXPR:
case TYPEID_EXPR:
return clk_ordinary;
new file mode 100644
@@ -0,0 +1,44 @@
+// PR c++/68978
+
+extern int x, y, z;
+
+template <typename T> int toi_1() {
+ int i = 0, c = 0, radix = 10, max = 0x7fffffff;
+ if (max < ((i *= radix) += c))
+ return 0;
+ return i;
+}
+
+template <typename T> int toi_2() {
+ int i = 0, c = 0, radix = 10, max = 0x7fffffff;
+ if (max < ((i = radix) = c))
+ return 0;
+ return i;
+}
+
+template <typename T> int toi_3() {
+ int i = 0, c = 0, radix = 10, max = 0x7fffffff;
+ if (max < ((i = radix) += c))
+ return 0;
+ return i;
+}
+
+template <typename T> int toi_4() {
+ int i = 0, c = 0, radix = 10, max = 0x7fffffff;
+ if (max < ((i += radix) = c))
+ return 0;
+ return i;
+}
+
+template <typename T> int toi_5() {
+ int i = 0, c = 0, radix = 10, max = 0x7fffffff;
+ if (max < (((i = radix) = (c += 5)) *= 30))
+ return 0;
+ return i;
+}
+
+int a = toi_1<int> ();
+int b = toi_2<int> ();
+int c = toi_3<int> ();
+int d = toi_4<int> ();
+int e = toi_5<int> ();