aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp23/init-stmt2.C
blob: ca6201bc34064ba05ff14f531bf27510af2f2eff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// PR c++/102617
// P2360R0: Extend init-statement to allow alias-declaration
// { dg-do compile { target c++23 } }
// Test invalid use.

int v[10];
namespace N { using X = int; }

void
g ()
{
  for (using N::X; false;) // { dg-error "expected" }
    ;
  for (using N::X; int e : v) // { dg-error "expected" }
    (void) e;
  for (using T = int; using U = int; int e : v) // { dg-error "" }
    ;
  if (using N::X; false) // { dg-error "expected" }
    {}
  switch (using N::X; 0) // { dg-error "expected" }
    ;
 if (using T = int;) // { dg-error "expected" }
  {
  }
}