blob: 5aeeb45f81e226c311f0159d419f88c70b8aef18 [file] [log] [blame]
// RUN: %clang_cc1 -fsyntax-only -std=c++20 -Wno-unused -Wunsequenced -verify %s
struct A {
int x, y;
};
void test() {
int a = 0;
A agg1( a++, a++ ); // no warning
A agg2( a++ + a, a++ ); // expected-warning {{unsequenced modification and access to 'a'}}
int arr1[]( a++, a++ ); // no warning
int arr2[]( a++ + a, a++ ); // expected-warning {{unsequenced modification and access to 'a'}}
}