p3.cpp revision 124b3def9ed99dc844225aeb6b17f789307500ee
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3int f();
4
5void 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
14void 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