diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-11 04:25:01 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-11 04:25:01 +0000 |
commit | c0004df84fca9225b66a50adc66cf21c34298227 (patch) | |
tree | 53fb95824e0ad18eaf33f7d6d1ca0d49a9e0358f /lib | |
parent | 983d835bead0134170a6646a8844926077c968d6 (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a2bf48e47a..588fc14044 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1463,8 +1463,6 @@ void Sema::MergeTypedefNameDecl(TypedefNameDecl *New, LookupResult &OldDecls) { // The types match. Link up the redeclaration chain if the old // declaration was a typedef. - // FIXME: this is a potential source of weirdness if the type - // spellings don't match exactly. if (TypedefNameDecl *Typedef = dyn_cast<TypedefNameDecl>(Old)) New->setPreviousDeclaration(Typedef); @@ -1509,8 +1507,8 @@ void Sema::MergeTypedefNameDecl(TypedefNameDecl *New, LookupResult &OldDecls) { return New->setInvalidDecl(); } - // Modules always permit redefinition of typedefs. - if (getLangOptions().Modules) + // Modules always permit redefinition of typedefs, as does C11. + if (getLangOptions().Modules || getLangOptions().C11) return; // If we have a redefinition of a typedef in C, emit a warning. This warning |