xref: /minix3/external/bsd/llvm/dist/clang/test/CXX/stmt.stmt/stmt.select/p3.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 int f();
4 
g()5 void g() {
6   if (int x = f()) { // expected-note 2{{previous definition}}
7     int x; // expected-error{{redefinition of 'x'}}
8   } else {
9     int x; // expected-error{{redefinition of 'x'}}
10   }
11 }
12 
13 
h()14 void h() {
15   if (int x = f()) // expected-note 2{{previous definition}}
16     int x; // expected-error{{redefinition of 'x'}}
17   else
18     int x; // expected-error{{redefinition of 'x'}}
19 }
20