]> granicus.if.org Git - clang/commit
Limit types of builtins that can be redeclared.
authorErich Keane <erich.keane@intel.com>
Mon, 16 Apr 2018 21:30:08 +0000 (21:30 +0000)
committerErich Keane <erich.keane@intel.com>
Mon, 16 Apr 2018 21:30:08 +0000 (21:30 +0000)
commit3857ab3c9e3fb78c18a66e1f3db0353d154b6b3b
tree575888875b571623279b5d3464b2dd3df1063d53
parent02d25f33f51916195f3374298c5e1deadd291b44
Limit types of builtins that can be redeclared.

As reported here: https://bugs.llvm.org/show_bug.cgi?id=37033
Any usage of a builtin function that uses a va_list by reference
will cause an assertion when redeclaring it.

After discussion in the review, it was concluded that the correct
way of accomplishing this fix is to make attempts to redeclare certain
builtins an error. Unfortunately, doing this limitation for all builtins
is likely a breaking change, so this commit simply limits it to
types with custom type checking and those that take a reference.

Two tests needed to be updated to make this work.

Differential Revision: https://reviews.llvm.org/D45383

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330160 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
include/clang/Basic/Builtins.h
include/clang/Basic/DiagnosticSemaKinds.td
lib/AST/ASTContext.cpp
lib/Basic/Builtins.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaOverload.cpp
test/Sema/builtin-redecl.cpp [new file with mode: 0644]