summaryrefslogtreecommitdiffstats
path: root/test/CXX/stmt.stmt/stmt.select/p3.cpp
blob: e674f9708c517c56f2c1a90e04b7beb47a422474 (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: %clang_cc1 -fsyntax-only -verify %s

int f();

void g() {
  if (int x = f()) { // expected-note 2{{previous definition}}
    int x; // expected-error{{redefinition of 'x'}}
  } else {
    int x; // expected-error{{redefinition of 'x'}}
  }
}
OpenPOWER on IntegriCloud