Re: CINT unable to correctly match a function call that has an typedef to enum argument.

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Thu, 5 Jun 2008 18:54:10 +0200


Hi Nick,

this has just been fixed in the trunk; thanks for the report!

Cheers, Axel

Nick West wrote:
> Dear Roottalk,
>
> Using the latest ROOT (svn update last night) on
>
> Scientific Linux SL release 4.6 (Beryllium)
> gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
>
> I have a problem with CINT which is unable to correctly match a
> function call that has an typedef to enum argument.
>
> If I define:-
>
> enum ESimFlag {kData = 0x01};
> void test_enum(ESimFlag mcflag) { std::cout << "enum works " << mcflag
> << std::endl; }
>
> then I can subsequently use them:-
>
> ESimFlag enum_data = kData;
> test_enum(enum_data);
>
> However, if I define a typedef:-
>
> typedef ESimFlag SimFlag_t;
>
> and a new function:-
>
> void test_typedef(SimFlag_t mcflag) { std::cout << "typedef works "
> << mcflag << std::endl; }
>
> then when I attempt to use them:-
>
> SimFlag_t typedef_data = kData;
> test_typedef(typedef_data);
>
> CINT reports:-
>
> Error: Function test_typedef(typedef_data) is not defined in current
> scope
>
> The attached macro demonstrates the problem. It works correctly if
> compiled:-
>
> root [0] .x test.C+
>
> enum works 1
> typedef works 1
>
> but:-
>
> root [1] .x test.C
> enum works 1
> Error: Function test_typedef(typedef_data) is not defined in current
> scope test.C:15:
> *** Interpreter error recovered ***
>
> It also works in CINT with 5.18/00c but I am afraid I don't know at
> what point after that it stopped working although Rene explained that
> work is currently in progress on the migration to Reflex so it is
> possible that this is related to that migration.
>
> Thanks,
>
> Nick West
>
>
Received on Thu Jun 05 2008 - 18:55:29 CEST

This archive was generated by hypermail 2.2.0 : Fri Jun 06 2008 - 11:50:02 CEST