diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-02 18:30:45 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-02 18:30:45 +0000 |
| commit | 570918821a8492048e6ab54955c9864bd6c3e952 (patch) | |
| tree | f9d0d3f3478c298aaf51987483bbbbefe8e6631b /lib/Sema/SemaOverload.cpp | |
| parent | f0c55418e2b09eaab37c820d3756cc1b4584d084 (diff) | |
Notes
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
| -rw-r--r-- | lib/Sema/SemaOverload.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 29ba34479dab..782c377e3202 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -11426,6 +11426,10 @@ static void AddOverloadedCallCandidate(Sema &S, assert(!KnownValid && "Explicit template arguments?"); return; } + // Prevent ill-formed function decls to be added as overload candidates. + if (!dyn_cast<FunctionProtoType>(Func->getType()->getAs<FunctionType>())) + return; + S.AddOverloadCandidate(Func, FoundDecl, Args, CandidateSet, /*SuppressUsedConversions=*/false, PartialOverloading); |
