Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium
New issue 405 by [email protected]: 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
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.