llvm-project/clang/test/SemaCXX/increment-decrement.cpp
Douglas Gregor a49ccfeeb2 The pre-increment/pre-decrement grammar in C++ differs from that in C,
but we were parsing the C grammar. Handle the C++ grammar
appropriately. Fixes PR7794.

llvm-svn: 110445
2010-08-06 14:50:36 +00:00

15 lines
280 B
C++

// 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;
}