brintos

brintos / llvm-project-archived public Read only

0
0
Text · 406 B · 5aeeb45 Raw
16 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -std=c++20 -Wno-unused -Wunsequenced -verify %s2 3struct A {4  int x, y;5};6 7void test() {8  int a = 0;9 10  A agg1( a++, a++ ); // no warning11  A agg2( a++ + a, a++ ); // expected-warning {{unsequenced modification and access to 'a'}}12 13  int arr1[]( a++, a++ ); // no warning14  int arr2[]( a++ + a, a++ ); // expected-warning {{unsequenced modification and access to 'a'}}15}16