mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-25 06:18:56 -04:00

We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
15 lines
464 B
C++
15 lines
464 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
// PR5515
|
|
|
|
extern int a[];
|
|
int a[10];
|
|
extern int b[10];
|
|
int b[];
|
|
extern int c[1];
|
|
int c[] = {1,2}; // expected-error {{excess elements in array initializer}}
|
|
|
|
int d[1][]; // expected-error {{array has incomplete element type 'int []'}}
|
|
|
|
extern const int e[2]; // expected-note {{previous declaration is here}}
|
|
int e[] = { 1 }; // expected-error {{redefinition of 'e' with a different type: 'int []' vs 'const int [2]'}}
|