const char * const * const member

From: Jochen Klein <Jochen.Klein_at_cern.ch>
Date: Thu, 8 Mar 2012 19:47:53 +0100


Hi,

when I tried to have a class with a member of type const char * const * const
the class itself compiles fine but there seems to be a problem with the ClassDef-generated code and I get the following error messages:



root [0] .L test.C+
Info in <TUnixSystem::ACLiC>: creating shared library /tmp/./test_C.so In file included from /tmp/test_C_ACLiC_dict.h:34:0,
                 from /tmp/test_C_ACLiC_dict.cxx:17:

/tmp/./test.C: In member function 'void test2::StreamerNVirtual(TBuffer&)':
/tmp/./test.C:19:3: warning: declaration of 'b' shadows a member of 'this'
/tmp/test_C_ACLiC_dict.cxx: In member function 'virtual void test2::ShowMembers(TMemberInspector&)':
/tmp/test_C_ACLiC_dict.cxx:115:63: error: 'constb' was not declared in this scope
g++: /tmp/test_C_ACLiC_dict.o: No such file or directory Error in <ACLiC>: Compilation failed!

Without the ClassDef it compiles as intended.

My objective is to have a constant (non-static) pointer to an array of constant pointers to string literals. The constness matters for optimization - at least I think it should but I have not verified it yet since it doesn't compile.

Does the warning point to a real problem or is it intended that the variable gets hidden?

In the assembly of "constb" instead of only b something goes wrong.

Am I overlooking something or is there really a problem? A simple class to reproduce the problem is attached.

Cheers,

   Jochen

Received on Thu Mar 08 2012 - 19:47:58 CET

This archive was generated by hypermail 2.2.0 : Fri Mar 09 2012 - 05:50:01 CET