]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/testsuite/g++.dg/template/non-dependent32.C
c++: lvalueness of non-dependent assignment expr [PR114994]
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / template / non-dependent32.C
diff --git a/gcc/testsuite/g++.dg/template/non-dependent32.C b/gcc/testsuite/g++.dg/template/non-dependent32.C
new file mode 100644 (file)
index 0000000..54252c7
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/114994
+// { dg-do compile { target c++11 } }
+
+struct udl_arg {
+  udl_arg operator=(int);
+};
+
+void f(udl_arg&&);
+
+template<class>
+void g() {
+  udl_arg x;
+  f(x=42); // { dg-bogus "cannot bind" }
+}
+
+int main() {
+  g<int>();
+}