summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2016-03-31 00:16:25 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2016-03-31 00:16:25 +0000
commit21d3bffe299ddb505cd9ae4f78fbdf92d61477c7 (patch)
tree83d9a5c49263ad7aaf4e1744320b32662a213d7e /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent514594bdd32799628608dec68d0fa8704940d7fa (diff)
downloadbcm5719-llvm-21d3bffe299ddb505cd9ae4f78fbdf92d61477c7.tar.gz
bcm5719-llvm-21d3bffe299ddb505cd9ae4f78fbdf92d61477c7.zip
[Sema] Fix PR27122: ICE with enable_if+ill-formed call.
In some cases, when we encounter a direct function call with an incorrect number of arguments, we'll emit a diagnostic, and pretend that the call to the function was valid. For example, in C: int foo(); int a = foo(1); Prior to this patch, we'd get an ICE if foo had an enable_if attribute, because CheckEnableIf assumes that the number of arguments it gets passed is valid for the function it's passed. Now, we check that the number of args looks valid prior to checking enable_if conditions. This fix was not done inside of CheckEnableIf because the problem presently can only occur in one caller of CheckEnableIf (ActOnCallExpr). Additionally, checking inside of CheckEnableIf would make us emit multiple diagnostics for the same error (one "enable_if failed", one "you gave this function the wrong number of arguments"), which seems worse than just complaining about the latter. llvm-svn: 264975
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud