Merge pull request #28707 from dtzWill/fix/cvc3

cvc3: Add gcc6 patch from Gentoo.

authored by Michael Raskin and committed by GitHub d75f8aef 371a2ee7

+78
+76
pkgs/applications/science/logic/cvc3/cvc3-2.4.1-gccv6-fix.patch
··· 1 + commit 4eb28b907e89be05d92eb704115f821b9b848e60 2 + Author: Matthew Dawson <matthew@mjdsystems.ca> 3 + Date: Sun Oct 16 22:06:03 2016 -0400 4 + 5 + Fix gcc v6 compile failures. 6 + 7 + * Use std::hash<const char*> over std::hash<char *>, as throwing away the const is not allowed. 8 + * Use Hash::hash by default in CDMap over std::hash, to get Hash::hash<CVC3::expr> 9 + 10 + diff --git a/src/expr/expr_value.cpp b/src/expr/expr_value.cpp 11 + index 0c85ff6..e4dd251 100644 12 + --- a/src/expr/expr_value.cpp 13 + +++ b/src/expr/expr_value.cpp 14 + @@ -29,7 +29,7 @@ namespace CVC3 { 15 + // Class ExprValue static members 16 + //////////////////////////////////////////////////////////////////////// 17 + 18 + -std::hash<char*> ExprValue::s_charHash; 19 + +std::hash<const char*> ExprValue::s_charHash; 20 + std::hash<long int> ExprValue::s_intHash; 21 + 22 + //////////////////////////////////////////////////////////////////////// 23 + diff --git a/src/include/cdmap.h b/src/include/cdmap.h 24 + index faf682a..c3b094c 100644 25 + --- a/src/include/cdmap.h 26 + +++ b/src/include/cdmap.h 27 + @@ -43,9 +43,9 @@ namespace CVC3 { 28 + // Auxiliary class: almost the same as CDO (see cdo.h), but on 29 + // setNull() call it erases itself from the map. 30 + 31 + -template <class Key, class Data, class HashFcn = std::hash<Key> > class CDMap; 32 + +template <class Key, class Data, class HashFcn = Hash::hash<Key> > class CDMap; 33 + 34 + -template <class Key, class Data, class HashFcn = std::hash<Key> > 35 + +template <class Key, class Data, class HashFcn = Hash::hash<Key> > 36 + class CDOmap :public ContextObj { 37 + Key d_key; 38 + Data d_data; 39 + diff --git a/src/include/expr_hash.h b/src/include/expr_hash.h 40 + index b2107d7..baa2eab 100644 41 + --- a/src/include/expr_hash.h 42 + +++ b/src/include/expr_hash.h 43 + @@ -20,7 +20,6 @@ 44 + * hash_set over Expr class. 45 + */ 46 + /*****************************************************************************/ 47 + - 48 + #ifndef _cvc3__expr_h_ 49 + #include "expr.h" 50 + #endif 51 + diff --git a/src/include/expr_value.h b/src/include/expr_value.h 52 + index 95102b2..f53aa4d 100644 53 + --- a/src/include/expr_value.h 54 + +++ b/src/include/expr_value.h 55 + @@ -179,7 +179,7 @@ protected: 56 + // Static hash functions. They don't depend on the context 57 + // (ExprManager and such), so it is still thread-safe to have them 58 + // static. 59 + - static std::hash<char*> s_charHash; 60 + + static std::hash<const char*> s_charHash; 61 + static std::hash<long int> s_intHash; 62 + 63 + static size_t pointerHash(void* p) { return s_intHash((long int)p); } 64 + diff --git a/src/theory_core/theory_core.cpp b/src/theory_core/theory_core.cpp 65 + index df5289f..37ccab9 100644 66 + --- a/src/theory_core/theory_core.cpp 67 + +++ b/src/theory_core/theory_core.cpp 68 + @@ -710,7 +710,7 @@ TheoryCore::TheoryCore(ContextManager* cm, 69 + // d_termTheorems(cm->getCurrentContext()), 70 + d_predicates(cm->getCurrentContext()), 71 + d_solver(NULL), 72 + - d_simplifyInPlace(false), 73 + + d_simplifyInPlace(NULL), 74 + d_currentRecursiveSimplifier(NULL), 75 + d_resourceLimit(0), 76 + d_timeBase(0),
+2
pkgs/applications/science/logic/cvc3/default.nix
··· 11 11 12 12 buildInputs = [ gmp flex bison perl ]; 13 13 14 + patches = [ ./cvc3-2.4.1-gccv6-fix.patch ]; 15 + 14 16 preConfigure = '' 15 17 sed -e "s@ /bin/bash@bash@g" -i Makefile.std 16 18 find . -exec sed -e "s@/usr/bin/perl@${perl}/bin/perl@g" -i '{}' ';'