aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/diagnostic/pr86993.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/diagnostic/pr86993.C')
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/pr86993.C13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr86993.C b/gcc/testsuite/g++.dg/diagnostic/pr86993.C
new file mode 100644
index 00000000000..313a489ae86
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/pr86993.C
@@ -0,0 +1,13 @@
+// PR c++/86993
+// { dg-options "-fdiagnostics-show-caret" }
+
+int
+main ()
+{
+ const int i = 5; // { dg-error "assignment of read-only variable 'i'" "" { target *-*-* } .+1 }
+ i = 5 + 6;
+/* { dg-begin-multiline-output "" }
+ i = 5 + 6;
+ ~~^~~~~~~
+ { dg-end-multiline-output "" } */
+}