Issue 405 in protobuf: c++ code generation for enum does not handle namespaces properly

65 views
Skip to first unread message

prot...@googlecode.com

unread,
Aug 7, 2012, 8:35:18 AM8/7/12
to prot...@googlegroups.com
Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 405 by jean....@gmail.com: c++ code generation for enum does
not handle namespaces properly
http://code.google.com/p/protobuf/issues/detail?id=405

What steps will reproduce the problem?
1. given two file :
--- enum_file.proto ---
package B.C;

enum SomeEnum
{
VALUEA = 1;
VALUEB = 2;
}

message X
{
required int64 value = 1;
}

--- message_file.proto ---
import "enum_file.proto";
package A.B;

message Y
{
required .B.C.SomeEnum e = 1;
required .B.C.X x = 2;
}

2. protoc --cpp_out=cpp *.proto
3. cpp/message_file.pb.h contains the following definitions :
inline B::C::SomeEnum e() const;
inline const ::B::C::X& x() const;

What is the expected output? What do you see instead?
we should expect "inline ::B::C::SomeEnum e() const;" (prefixed with ::)
else the compiler believes that B::C::SomeEnum is inside namespace A and
look up for A::B::C::SomeEnum which does not exists.

What version of the product are you using? On what operating system?
protoc 2.4.1 on Linux 2.6.32-64bit


prot...@googlecode.com

unread,
Aug 7, 2012, 8:54:57 AM8/7/12
to prot...@googlegroups.com
Updates:
Status: Accepted

Comment #1 on issue 405 by liuj...@google.com: c++ code generation for enum
does not handle namespaces properly
http://code.google.com/p/protobuf/issues/detail?id=405

(No comment was entered for this change.)

prot...@googlecode.com

unread,
Aug 7, 2012, 9:00:29 AM8/7/12
to prot...@googlegroups.com
Updates:
Labels: FixedIn-2.5.0

Comment #2 on issue 405 by liuj...@google.com: c++ code generation for enum
does not handle namespaces properly
http://code.google.com/p/protobuf/issues/detail?id=405

This has been fixed internally. Will be included in the next release.

rhlake

unread,
Sep 24, 2012, 1:37:55 PM9/24/12
to prot...@googlegroups.com, codesite...@google.com, prot...@googlecode.com
When are you planning on releasing version 2.5.0 ?
 
do you have a list of items that are being addressed in 2.5.0 ?
 
thank you,
Robert

prot...@googlecode.com

unread,
Dec 4, 2012, 5:41:22 PM12/4/12
to prot...@googlegroups.com
Updates:
Status: Fixed

Comment #3 on issue 405 by xiaof...@google.com: c++ code generation for
enum does not handle namespaces properly
http://code.google.com/p/protobuf/issues/detail?id=405

Fixed in r425.

Reply all
Reply to author
Forward
0 new messages