summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/cond4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/expr/cond4.C')
-rw-r--r--gcc/testsuite/g++.dg/expr/cond4.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/expr/cond4.C b/gcc/testsuite/g++.dg/expr/cond4.C
new file mode 100644
index 000000000..fff5c8b18
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/cond4.C
@@ -0,0 +1,16 @@
+// PR c++/13971
+
+struct QChar {
+ static const QChar null;
+};
+struct QCharRef {
+ operator QChar() const;
+};
+struct QString {
+ QCharRef operator[](int i);
+};
+
+QChar fillParagraph(QString s, int psi) {
+ return psi ? QChar::null : s[psi];
+}
+