Sylwester Lachiewicz created THRIFT-6344:
--------------------------------------------

             Summary: D generator: the reserved word list has "macro " with a 
trailing space
                 Key: THRIFT-6344
                 URL: https://issues.apache.org/jira/browse/THRIFT-6344
             Project: Thrift
          Issue Type: Bug
          Components: D - Compiler
    Affects Versions: 0.25.0
            Reporter: Sylwester Lachiewicz


The {{d_reserved_words}} table in 
[t_d_generator.cc:769|https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_d_generator.cc#L769]
 contains {{"macro "}}, so a field or function named {{macro}} is never escaped.

{code}
struct S { 1: i32 macro }
{code}
{noformat}
$ thrift --gen d repro.thrift && grep -n macro gen-d/repro_types.d
14:  int macro;
17:    TFieldMeta(`macro`, 1, TReq.OPT_IN_REQ_OUT)
{noformat}

With the space removed the field is written as {{macro_}}, like the other 
reserved words. Reproduced on master at 3af0cfff1.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to