]> git.pld-linux.org Git - packages/Yap.git/blame - Friend-function-template-defined-in-a-class-cannot-b.patch
- build only on x86 and x86_64
[packages/Yap.git] / Friend-function-template-defined-in-a-class-cannot-b.patch
CommitLineData
9c30d598
JR
1From 92d5303c23fcc698233b754fc8f180df1fa2aa9b Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
3Date: Thu, 12 Feb 2015 17:37:57 +0100
4Subject: [PATCH] Friend function template defined in a class cannot be used
5 without ADL
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10GCC 5.0 stopped searching friend function templates without ADL.
11
12The Clause_new() function can be kept a friend but must be defined out
13of scope of the Clause class, or the callers must use fully
14qualificated name (Clause::Clause_new()) and the method must be
15changed from friend to static.
16
17So far my poor C++ knowledge.
18
19Signed-off-by: Petr Písař <ppisar@redhat.com>
20---
21 packages/swi-minisat2/C/Solver.C | 4 ++--
22 packages/swi-minisat2/C/SolverTypes.h | 2 +-
23 2 files changed, 3 insertions(+), 3 deletions(-)
24
25diff --git a/packages/swi-minisat2/C/Solver.C b/packages/swi-minisat2/C/Solver.C
26index 2de3e6d..1bcdbff 100644
27--- a/packages/swi-minisat2/C/Solver.C
28+++ b/packages/swi-minisat2/C/Solver.C
29@@ -120,7 +120,7 @@ bool Solver::addClause(vec<Lit>& ps)
30 uncheckedEnqueue(ps[0]);
31 return ok = (propagate() == NULL);
32 }else{
33- Clause* c = Clause_new(ps, false);
34+ Clause* c = Clause::Clause_new(ps, false);
35 clauses.push(c);
36 attachClause(*c);
37 }
38@@ -599,7 +599,7 @@ lbool Solver::search(int nof_conflicts, int nof_learnts)
39 if (learnt_clause.size() == 1){
40 uncheckedEnqueue(learnt_clause[0]);
41 }else{
42- Clause* c = Clause_new(learnt_clause, true);
43+ Clause* c = Clause::Clause_new(learnt_clause, true);
44 learnts.push(c);
45 attachClause(*c);
46 claBumpActivity(*c);
47diff --git a/packages/swi-minisat2/C/SolverTypes.h b/packages/swi-minisat2/C/SolverTypes.h
48index 47e3023..919b60b 100644
49--- a/packages/swi-minisat2/C/SolverTypes.h
50+++ b/packages/swi-minisat2/C/SolverTypes.h
51@@ -119,7 +119,7 @@ public:
52
53 // -- use this function instead:
54 template<class V>
55- friend Clause* Clause_new(const V& ps, bool learnt = false) {
56+ static Clause* Clause_new(const V& ps, bool learnt = false) {
57 assert(sizeof(Lit) == sizeof(uint32_t));
58 assert(sizeof(float) == sizeof(uint32_t));
59 void* mem = malloc(sizeof(Clause) + sizeof(uint32_t)*(ps.size()));
60--
611.9.3
62
This page took 0.064241 seconds and 4 git commands to generate.