Results 1 to 3 of 3

Thread: template error in nested slice modules

  1. #1
    n2503v is offline Registered User
    Name: Alex Makarenko
    Organization: ACFR, University of Sydney
    Project: Orca
    Join Date
    Jun 2005
    Posts
    134

    template error in nested slice modules

    Hi all,
    while recompiling our C++ code with Ice-3.4 I came across a compile error in slice generated files.

    Ice-3.4.0, C++, Linux, gcc-4.2/4.3/4.4

    It seems that any 2 nested modules with contents on the both inner and outer levels will trigger this. Here's a simple example:

    Code:
    module m1
    {
        struct S1
        {
            int var;
        };
           
        module m2
        {
            struct S2
            {
                int var;
            };
        };
    };
    the compiler error:

    In file included from nested.cpp:21:nested.h:242: error: specialization of ‘template<class T> struct Ice::StreamTrait’ in different namespace
    /opt/Ice-3.4.0/include/Ice/Stream.h:56: error: from definition of ‘template<class T> struct Ice::StreamTrait’
    Removing either S1 or S2 definition leads to a clean compilation.

    Has anybody encountered a similar problem?

    Cheers,
    Alex
    Alex Makarenko
    Marathon Robotics
    project: multi-robot systems

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,424
    Hi Alex,

    Thanks for reporting this bug. It's too bad you didn't try this a few days ago, before we released 3.4.0.

    I've posted a source patch here. You'll need to build a new version of slice2cpp.

    Regards,
    Mark

  3. #3
    n2503v is offline Registered User
    Name: Alex Makarenko
    Organization: ACFR, University of Sydney
    Project: Orca
    Join Date
    Jun 2005
    Posts
    134
    Doh! I should've tried to find some time to do it last week.

    Your patch fixed it, thanks for that. The rest built without problems.

    Thanks,
    Alex
    Alex Makarenko
    Marathon Robotics
    project: multi-robot systems

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. slice2cpp streaming API bug with nested modules
    By PrzemekD in forum Bug Reports
    Replies: 3
    Last Post: 05-26-2010, 01:52 PM
  2. Nested Modules
    By Ryuga in forum Help Center
    Replies: 1
    Last Post: 02-25-2009, 06:18 AM
  3. slice2html creates broken links for nested modules
    By mefoster in forum Bug Reports
    Replies: 1
    Last Post: 05-01-2007, 07:25 PM
  4. Replies: 1
    Last Post: 04-02-2007, 06:41 PM
  5. docs: reference to other modules in slice
    By n2503v in forum Comments
    Replies: 2
    Last Post: 11-20-2006, 05:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •