diff options
author | Richard Trieu <rtrieu@google.com> | 2013-08-08 01:50:23 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2013-08-08 01:50:23 +0000 |
commit | fbbdc5daee4dc772d4d137080890fd79492592d6 (patch) | |
tree | 7cdae24e740136717457e9672257c3eb8549d12b /test/Sema | |
parent | 9793fe99de5ab92162cb70a7d2584c1de0952d73 (diff) | |
download | clang-fbbdc5daee4dc772d4d137080890fd79492592d6.tar.gz |
Emit an error for enum increments and decrements in C++ mode.
Fixes PR16394.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/enum-increment.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Sema/enum-increment.c b/test/Sema/enum-increment.c new file mode 100644 index 0000000000..baaa3489b9 --- /dev/null +++ b/test/Sema/enum-increment.c @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -fsyntax-only %s -verify +// expected-no-diagnostics +enum A { A1, A2, A3 }; +typedef enum A A; +void test() { + A a; + a++; + a--; + ++a; + --a; + a = a + 1; + a = a - 1; +} |