This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
C11 allows typedefs to be redefined. Implement this in C11 mode, and
downgrade the default-error warning to an ExtWarn in C90/99. <rdar://problem/10668057> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147925 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
983d835
commit c0004df
Showing
4 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // RUN: %clang_cc1 -std=c11 %s -verify | ||
|
|
||
| typedef int type; | ||
| typedef type type; | ||
| typedef int type; | ||
|
|
||
| void f(int N) { | ||
| typedef int type2; | ||
| typedef type type2; | ||
| typedef int type2; | ||
|
|
||
| typedef int vla[N]; // expected-note{{previous definition is here}} | ||
| typedef int vla[N]; // expected-error{{typedef redefinition with different types ('int [N]' vs 'int [N]')}} | ||
| } |