[
https://issues.apache.org/jira/browse/AVRO-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17855008#comment-17855008
]
ASF subversion and git services commented on AVRO-3990:
-------------------------------------------------------
Commit 6aeb7b7aa10ef721f3a16158900205ecab7174b1 in avro's branch
refs/heads/main from Gerrit Birkeland
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=6aeb7b7aa ]
AVRO-3990 [C++] Fix invalid code generation for union with reserved name (#2930)
> [C++] avrogencpp generates invalid code for union with a reserved word
> ----------------------------------------------------------------------
>
> Key: AVRO-3990
> URL: https://issues.apache.org/jira/browse/AVRO-3990
> Project: Apache Avro
> Issue Type: Bug
> Reporter: Gerrit Birkeland
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When avrogencpp is run with this schema, it generates C++ code with compiler
> errors due to inconsistently passing names through the {{decorate}} wrapper.
> {code:java}
> {
> "type": "record",
> "name": "Record",
> "fields": [
> {
> "name": "void",
> "type": [
> "int",
> "double"
> ]
> }
> ]
> }
> {code}
> This generates the following, note that the typedef uses {{void_t}} (one
> underscore) while references to the typedef use {{void__t}} (two underscores)
> {code:java}
> struct Record {
> typedef _cpp_reserved_words_union_typedef_Union__0__ void_t;
> void__t void_;
> Record() :
> void_(void__t())
> { }
> };
> {code}
> Note: This problem was injected after the latest release, so can only be
> reproduced with a build off of the current repo.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)