You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
437 B
20 lines
437 B
// 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'}}
|
|
}
|
|
}
|
|
|
|
|
|
void h() {
|
|
if (int x = f()) // expected-note 2{{previous definition}}
|
|
int x; // expected-error{{redefinition of 'x'}}
|
|
else
|
|
int x; // expected-error{{redefinition of 'x'}}
|
|
}
|