]> granicus.if.org Git - clang/commit
[Sema] Fix a crash on variadic enable_if functions.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Fri, 12 Aug 2016 04:12:31 +0000 (04:12 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Fri, 12 Aug 2016 04:12:31 +0000 (04:12 +0000)
commitd6290c5e5b763ba2aef19f621b95a41c5dee761f
tree7c8745ecfa163d6e2cd878c8d27bab7cc895f1f5
parentbcd0b9f9023b35616284426cc1e049c0a1232460
[Sema] Fix a crash on variadic enable_if functions.

Currently, when trying to evaluate an enable_if condition, we try to
evaluate all arguments a user passes to a function. Given that we can't
use variadic arguments from said condition anyway, not converting them
is a reasonable thing to do. So, this patch makes us ignore any varargs
when attempting to check an enable_if condition.

We'd crash because, in order to convert an argument, we need its
ParmVarDecl. Variadic arguments don't have ParmVarDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278471 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaOverload.cpp
test/Sema/enable_if.c
test/SemaCXX/enable_if.cpp