Message ID | 1325707497-10913-1-git-send-email-ville.skytta@iki.fi |
---|---|
State | New |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <ville.skytta@iki.fi>) id 1RiX52-0008Ch-Q3 for vdr@linuxtv.org; Wed, 04 Jan 2012 21:05:02 +0100 X-tubIT-Incoming-IP: 213.243.153.184 Received: from filtteri1.pp.htv.fi ([213.243.153.184]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for <vdr@linuxtv.org> id 1RiX52-0002H7-F8; Wed, 04 Jan 2012 21:05:00 +0100 Received: from localhost (localhost [127.0.0.1]) by filtteri1.pp.htv.fi (Postfix) with ESMTP id BA464BFAA for <vdr@linuxtv.org>; Wed, 4 Jan 2012 22:04:58 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp5.welho.com ([213.243.153.39]) by localhost (filtteri1.pp.htv.fi [213.243.153.184]) (amavisd-new, port 10024) with ESMTP id hl58GEHSiSYR for <vdr@linuxtv.org>; Wed, 4 Jan 2012 22:04:58 +0200 (EET) Received: from viper.bobcat.mine.nu.bobcat.mine.nu (cs181085020.pp.htv.fi [82.181.85.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp5.welho.com (Postfix) with ESMTPS id 166225BC003 for <vdr@linuxtv.org>; Wed, 4 Jan 2012 22:04:58 +0200 (EET) From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi> To: vdr@linuxtv.org Date: Wed, 4 Jan 2012 22:04:57 +0200 Message-Id: <1325707497-10913-1-git-send-email-ville.skytta@iki.fi> X-Mailer: git-send-email 1.7.7.5 X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.1.4.195714 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_600_699 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -1.9 (-) X-LSpam-Report: No, score=-1.9 required=5.0 tests=BAYES_00=-1.9 autolearn=ham Subject: [vdr] [PATCH] Fix build with g++ 4.7.0. X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List <vdr@linuxtv.org> List-Id: VDR Mailing List <vdr.linuxtv.org> List-Unsubscribe: <http://www.linuxtv.org/cgi-bin/mailman/options/vdr>, <mailto:vdr-request@linuxtv.org?subject=unsubscribe> List-Archive: <http://www.linuxtv.org/pipermail/vdr> List-Post: <mailto:vdr@linuxtv.org> List-Help: <mailto:vdr-request@linuxtv.org?subject=help> List-Subscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=subscribe> X-List-Received-Date: Wed, 04 Jan 2012 20:05:02 -0000 Status: O X-Status: X-Keywords: X-UID: 25548 |
Commit Message
Ville Skyttä
Jan. 4, 2012, 8:04 p.m. UTC
This is the PR24163 case mentioned in http://article.gmane.org/gmane.linux.redhat.fedora.devel/157671 --- config.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Comments
Am 04.01.2012 21:04, schrieb Ville Skyttä: > This is the PR24163 case mentioned in > http://article.gmane.org/gmane.linux.redhat.fedora.devel/157671 > > diff --git a/config.h b/config.h > index 7825364..b0233a9 100644 > --- a/config.h > +++ b/config.h > @@ -122,7 +122,7 @@ public: > if (!isempty(s)) { > T *l = new T; > if (l->Parse(s)) > - Add(l); > + this->Add(l); > else { > esyslog("ERROR: error in %s, line %d", fileName, line); > delete l; This is one of the cases where it seems appropriate to have a lawyer for every C++ coder, just in case he needs to wrangle the standard... For info, the above references 14.6.2/3 of the ISO C++ standard, which is: > In the definition of a class template or a member of a class template, if a base class of the class template > depends on a template-parameter, the base class scope is not examined during unqualified name lookup > either at the point of definition of the class template or member or during an instantiation of the class tem- > plate or member. [Example: > typedef double A; > template<class T> class B { > typedef int A; > }; > template<class T> struct X : B<T> { > A a; // a has type double > }; > The type name A in the definition of X<T> binds to the typedef name defined in the global namespace > scope, not to the typedef name defined in the base class B<T>. ] In our case, I'm not sure if another solution would be to pull in the Add() method manually, by adding an using cList<T>::Add; to the class definition. There's a similar use of this->First() in Save() that already requires the this-> in current compilers, and it can also be resolved by an using cList<T>::First; . Cheers, Udo
diff --git a/config.h b/config.h index 7825364..b0233a9 100644 --- a/config.h +++ b/config.h @@ -122,7 +122,7 @@ public: if (!isempty(s)) { T *l = new T; if (l->Parse(s)) - Add(l); + this->Add(l); else { esyslog("ERROR: error in %s, line %d", fileName, line); delete l;