aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 474c1e490e..b024d36acc 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -524,6 +524,12 @@ bool Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) {
return false;
}
+ // __builtin_va_list gets redeclared in the built-in definitions
+ // buffer when using PCH. Don't complain about such redefinitions.
+ if (Context.getExternalSource() &&
+ strcmp(SourceMgr.getBufferName(New->getLocation()), "<built-in>") == 0)
+ return false;
+
Diag(New->getLocation(), diag::err_redefinition) << New->getDeclName();
Diag(Old->getLocation(), diag::note_previous_definition);
return true;