Results 1 to 2 of 2

Thread: PointerType Bug

  1. #1
    rspencer is offline Registered User
    Name: Reid Spencer
    Organization: Doyenz
    Project: Disaster Recovery
    Join Date
    Jan 2010
    Location
    Seattle, WA
    Posts
    10

    PointerType Bug

    I just created a slice file that produces C++ code that does not compile. The offending slice code is this:

    class Type;
    class PointerType extends Type
    {
    Type otherType;
    };
    The generated C++ code looks like this:

    class PointerType : virtual public ::Type
    {
    public:

    typedef PointerTypePrx ProxyType;
    typedef PointerTypePtr PointerType;

    //....
    }
    My gcc compiler produces an error like this:

    error: ISO C++ forbids nested type ‘PointerType’ with same name as enclosing class
    error: PointerType::PointerType’ has the same name as the class in which it is declared
    This isn't a huge deal, I can just rename the class.

    However, slice2cpp should probably catch this. This would also be the case if one named the slice class "ProxyType".

    This happens with slice2cpp 3.3.1 on:
    Linux 2.6.31-19-generic-pae #56-Ubuntu SMP Thu Jan 28 02:29:51 UTC 2010 i686 GNU/Linux

  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,441
    Hi Reid,

    Thanks for reporting this. Ideally the generated code should not use symbols that could conflict with Slice type names.

    Regards,
    Mark

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Bug of Glacier2Router
    By GlacierX in forum Bug Reports
    Replies: 5
    Last Post: 04-11-2007, 05:00 AM
  2. bug ?
    By OrNot in forum Bug Reports
    Replies: 1
    Last Post: 12-03-2005, 03:58 AM
  3. is it a bug or conflict ?
    By fw_csha in forum Help Center
    Replies: 2
    Last Post: 05-20-2005, 08:50 AM
  4. Is this a bug?
    By GlacierX in forum Bug Reports
    Replies: 5
    Last Post: 05-17-2005, 09:54 AM
  5. much like a Bug !
    By damingyipai in forum Bug Reports
    Replies: 4
    Last Post: 04-04-2004, 12:41 AM

Posting Permissions

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