summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/inc-decrement-qualifiers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/inc-decrement-qualifiers.cpp')
-rw-r--r--test/SemaCXX/inc-decrement-qualifiers.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/inc-decrement-qualifiers.cpp b/test/SemaCXX/inc-decrement-qualifiers.cpp
new file mode 100644
index 0000000..ba837a9
--- /dev/null
+++ b/test/SemaCXX/inc-decrement-qualifiers.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+volatile int i;
+
+const int &inc = i++;
+const int &dec = i--;
+
+const int &incfail = ++i; // expected-error {{drops qualifiers}}
+const int &decfail = --i; // expected-error {{drops qualifiers}}
OpenPOWER on IntegriCloud