[ 
https://issues.apache.org/jira/browse/AVRO-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Tzvetanov Grigorov resolved AVRO-3990.
---------------------------------------------
    Fix Version/s: 1.12.0
         Assignee: Gerrit Birkeland
       Resolution: Fixed

> [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
>            Assignee: Gerrit Birkeland
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0
>
>          Time Spent: 0.5h
>  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)

Reply via email to