mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
THRIFT-554. multiple enums with the same key generate invalid code
This patch causes multiple enums with the same name to trigger a parser error. Patch: Ben Taitelbaum git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982825 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5a9fc65f55
commit
8fc413fbfd
@ -60,9 +60,14 @@ class t_scope {
|
||||
}
|
||||
|
||||
void add_constant(std::string name, t_const* constant) {
|
||||
if (constants_.find(name) != constants_.end()) {
|
||||
throw "Enum " + name + " is already defined!";
|
||||
} else {
|
||||
constants_[name] = constant;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
t_const* get_constant(std::string name) {
|
||||
return constants_[name];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user