[llvm-commits] [test-suite] r97697 - /test-suite/trunk/MultiSource/Applications/minisat/SolverTypes.h
Douglas Gregor
dgregor at apple.com
Wed Mar 3 16:30:15 PST 2010
Author: dgregor
Date: Wed Mar 3 18:30:15 2010
New Revision: 97697
URL: http://llvm.org/viewvc/llvm-project?rev=97697&view=rev
Log:
Fix minisat not to require GCC's overly promiscuous search for friend
templates in places where it's not permitted to look. Clang diagnosed
the ill-formed code, GCC did not.
Modified:
test-suite/trunk/MultiSource/Applications/minisat/SolverTypes.h
Modified: test-suite/trunk/MultiSource/Applications/minisat/SolverTypes.h
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/minisat/SolverTypes.h?rev=97697&r1=97696&r2=97697&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/minisat/SolverTypes.h (original)
+++ test-suite/trunk/MultiSource/Applications/minisat/SolverTypes.h Wed Mar 3 18:30:15 2010
@@ -117,14 +117,6 @@
for (int i = 0; i < ps.size(); i++) data[i] = ps[i];
if (learnt) extra.act = 0; else calcAbstraction(); }
- // -- use this function instead:
- template<class V>
- friend Clause* Clause_new(const V& ps, bool learnt = false) {
- assert(sizeof(Lit) == sizeof(uint32_t));
- assert(sizeof(float) == sizeof(uint32_t));
- void* mem = malloc(sizeof(Clause) + sizeof(uint32_t)*(ps.size()));
- return new (mem) Clause(ps, learnt); }
-
int size () const { return size_etc >> 3; }
void shrink (int i) { assert(i <= size()); size_etc = (((size_etc >> 3) - i) << 3) | (size_etc & 7); }
void pop () { shrink(1); }
@@ -146,6 +138,14 @@
void strengthen (Lit p);
};
+// -- use this function instead:
+template<class V>
+Clause* Clause_new(const V& ps, bool learnt = false) {
+ assert(sizeof(Lit) == sizeof(uint32_t));
+ assert(sizeof(float) == sizeof(uint32_t));
+ void* mem = malloc(sizeof(Clause) + sizeof(uint32_t)*(ps.size()));
+ return new (mem) Clause(ps, learnt);
+}
/*_________________________________________________________________________________________________
|
More information about the llvm-commits
mailing list