Re: [vdr] [PATCH] Fix build with g++ 4.7.0.

2012-01-04 Thread Udo Richter
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 B {
>typedef int A;
> };
> template struct X : B {
>A a;// a has type double
> };
> The type name A in the definition of X binds to the typedef name defined 
> in the global namespace
> scope, not to the typedef name defined in the base class B. ]


In our case, I'm not sure if another solution would be to pull in the
Add() method manually, by adding an
  using cList::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::First;
.


Cheers,

Udo

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] [PATCH] Fix build with g++ 4.7.0.

2012-01-04 Thread Ville Skyttä
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(-)

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;
-- 
1.7.7.5


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr