Andreas Renggli created THRIFT-5529:
---------------------------------------
Summary: Missing space "<::" in C++ generator
Key: THRIFT-5529
URL: https://issues.apache.org/jira/browse/THRIFT-5529
Project: Thrift
Issue Type: Bug
Components: C++ - Compiler
Affects Versions: 0.16.0
Environment: Microsoft Visual Studio Professional 2022
Version 17.1.0
VisualStudio.17.Release/17.1.0+32210.238
Reporter: Andreas Renggli
Fix For: 0.17.0
Autogenerated code in C++ is missing space between "<" and "::"
e.G.:
{code:java}
if (style == "Concurrent") {
f_header_ << ",
std::shared_ptr<::apache::thrift::async::TConcurrentClientSyncInfo> sync";
}{code}
Code cannot be compiled due to needed leading space, in case the name is used
inside of a template parameter. "MyTemplate<::foo::Bar>" is not valid C++,
since "<:" is an alternative token for "[". as mentioned here
[t_cpp_generator.cc|https://github.com/apache/thrift/blob/8fea4ea0c1469bef5c06efd9a125b94f3bf66922/compiler/cpp/src/thrift/generate/t_cpp_generator.cc#L4324]
--
This message was sent by Atlassian Jira
(v8.20.1#820001)