diff options
Diffstat (limited to 'clang/test/SemaCXX/increment-decrement.cpp')
-rw-r--r-- | clang/test/SemaCXX/increment-decrement.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/increment-decrement.cpp b/clang/test/SemaCXX/increment-decrement.cpp new file mode 100644 index 0000000..11b7d1e --- /dev/null +++ b/clang/test/SemaCXX/increment-decrement.cpp @@ -0,0 +1,14 @@ +// 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}} + +// PR7794 +void f0(int e) { + ++(int&)e; +} |