pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/53190: 2 extra patches for news/nget for g++ 4.9.
>Number: 53190
>Category: pkg
>Synopsis: 2 extra patches for news/nget for g++ 4.9.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Apr 16 20:10:00 +0000 2018
>Originator: Rhialto
>Release: NetBSD 7.0.1
>Organization:
>Environment:
System: NetBSD murthe.falu.nl 7.0.1 NetBSD 7.0.1 (MURTHE7.0.1) #0: Tue Jun 7 23:03:24 CEST 2016 rhialto%murthe.falu.nl@localhost:/usr/src/sys/arch/amd64/compile/MURTHE7.0.1 amd64
Architecture: x86_64
Machine: amd64
>Description:
Building the news/nget package fails with gcc 4.9.x.
Older compiler versions were apparently more lax with their checking of const.
I added a template with an extra const; maybe the version without const is not needed but I didn't check.
+pred<ClassType> *new_comparison(RetType (ClassType::*memberf)(void) const, RetType v){
^^^^^ new
>How-To-Repeat:
cd /usr/pkgsrc/news/nget && make
>Fix:
2 new patches:
patch-etree.cc:
$NetBSD$
Improve const-correctness.
--- etree.cc.orig 2018-04-16 19:50:09.000000000 +0000
+++ etree.cc
@@ -82,6 +82,10 @@ template <template <class A, class B> cl
pred<ClassType> *new_comparison(RetType (ClassType::*memberf)(void), RetType v){
return new Comparison<Op, MemfuncGetter, RetType, ClassType>(memberf, v);
}
+template <template <class A, class B> class Op, class ClassType, class RetType>
+pred<ClassType> *new_comparison(RetType (ClassType::*memberf)(void) const, RetType v){
+ return new Comparison<Op, MemfuncGetter, RetType, ClassType>(memberf, v);
+}
template <class ClassType, class getterT, class T2>
pred<ClassType> *comparison(const string &opstr, getterT get, T2 v) {
if (opstr.compare("==")==0) return new_comparison<Op_eq,ClassType>(get, v);
@@ -115,6 +119,10 @@ template <template <class A, class B> cl
pred<ClassType> *new_comparison_re(RetType (ClassType::*memberf)(void), const char *pattern, int flags){
return new Comparison_re<Op, MemfuncGetter, RetType, ClassType>(memberf, pattern, flags);
}
+template <template <class A, class B> class Op, class ClassType, class RetType>
+pred<ClassType> *new_comparison_re(RetType (ClassType::*memberf)(void) const, const char *pattern, int flags){
+ return new Comparison_re<Op, MemfuncGetter, RetType, ClassType>(memberf, pattern, flags);
+}
template <class ClassType, class getterT>
pred<ClassType> *comparison_re(const string &opstr, getterT get, const char *pattern, int flags) {
//typedef const string &T;
patch-getter.h:
$NetBSD$
Improve const-correctness.
--- getter.h.orig 2018-04-16 19:54:17.000000000 +0000
+++ getter.h
@@ -35,7 +35,7 @@ class MemGetter {
template <class RetType, class ClassType>
class MemfuncGetter {
private:
- typedef RetType (ClassType::*member_t)(void);
+ typedef RetType (ClassType::*member_t)(void) const;
member_t member;
public:
typedef RetType T;
-Olaf.
--
___ Olaf 'Rhialto' Seibert -- Wayland: Those who don't understand X
\X/ rhialto/at/falu.nl -- are condemned to reinvent it. Poorly.
Home |
Main Index |
Thread Index |
Old Index