THRIFT-5179: Fix generated code for struct's named "a" or "b"

Client: cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index 608e488..f1c808e 100755
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -167,6 +167,7 @@
 	ThriftTest.thrift \
 	TypedefTest.thrift \
 	UnsafeTypes.thrift \
+	SpecificNameTest.thrift \
 	known_failures_Linux.json \
 	test.py \
 	tests.json \
diff --git a/test/SpecificNameTest.thrift b/test/SpecificNameTest.thrift
new file mode 100644
index 0000000..165fc31
--- /dev/null
+++ b/test/SpecificNameTest.thrift
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+namespace cpp test.specificname
+
+struct a {
+  1: i32 number,
+  2: string message,
+}
+
+struct b {
+  1: i32 number,
+  2: string message,
+}
+
+service EchoService {
+  void echoA(1: a arg),
+  void echoB(2: b arg),
+}
diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt
index 367b6de..9ecc171 100755
--- a/test/cpp/CMakeLists.txt
+++ b/test/cpp/CMakeLists.txt
@@ -56,6 +56,13 @@
 add_library(crossstressgencpp STATIC ${crossstressgencpp_SOURCES})
 LINK_AGAINST_THRIFT_LIBRARY(crossstressgencpp thrift)
 
+set(crossspecificnamegencpp_SOURCES
+    gen-cpp/EchoService.cpp 
+    gen-cpp/SpecificNameTest_types.cpp
+)
+add_library(crossspecificnamegencpp STATIC ${crossspecificnamegencpp_SOURCES})
+LINK_AGAINST_THRIFT_LIBRARY(crossspecificnamegencpp thrift)
+
 add_executable(TestServer src/TestServer.cpp)
 target_link_libraries(TestServer crosstestgencpp ${Boost_LIBRARIES} ${LIBEVENT_LIB})
 LINK_AGAINST_THRIFT_LIBRARY(TestServer thrift)
@@ -86,6 +93,12 @@
     add_test(NAME StressTestNonBlocking COMMAND StressTestNonBlocking)
 endif()
 
+add_executable(SpecificNameTest src/SpecificNameTest.cpp)
+target_link_libraries(SpecificNameTest crossspecificnamegencpp ${Boost_LIBRARIES} ${LIBEVENT_LIB})
+LINK_AGAINST_THRIFT_LIBRARY(SpecificNameTest thrift)
+LINK_AGAINST_THRIFT_LIBRARY(SpecificNameTest thriftnb)
+add_test(NAME SpecificNameTest COMMAND SpecificNameTest)
+
 #
 # Common thrift code generation rules
 #
@@ -97,3 +110,7 @@
 add_custom_command(OUTPUT gen-cpp/Service.cpp
     COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/StressTest.thrift
 )
+
+add_custom_command(OUTPUT gen-cpp/EchoService.cpp gen-cpp/SpecificNameTest_types.cpp
+    COMMAND ${THRIFT_COMPILER} --gen cpp ${PROJECT_SOURCE_DIR}/test/SpecificNameTest.thrift
+)
diff --git a/test/cpp/Makefile.am b/test/cpp/Makefile.am
index 4f77c15..d3754f4 100755
--- a/test/cpp/Makefile.am
+++ b/test/cpp/Makefile.am
@@ -103,6 +103,9 @@
 gen-cpp/Service.cpp: $(top_srcdir)/test/StressTest.thrift $(THRIFT)
 	$(THRIFT) --gen cpp $<
 
+gen-cpp/SpecificNameTest_types.cpp gen-cpp/EchoService.cpp: $(top_srcdir)/test/SpecificName.thrift $(THRIFT)
+	$(THRIFT) --gen cpp $<
+
 AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(LIBEVENT_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src -Igen-cpp -I.
 AM_CXXFLAGS = -Wall -Wextra -pedantic -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
 AM_LDFLAGS = $(BOOST_LDFLAGS) $(LIBEVENT_LDFLAGS) $(ZLIB_LIBS)
diff --git a/test/cpp/src/SpecificNameTest.cpp b/test/cpp/src/SpecificNameTest.cpp
new file mode 100644
index 0000000..9c31ac1
--- /dev/null
+++ b/test/cpp/src/SpecificNameTest.cpp
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+int main(int argc, char** argv) {
+  
+  //Empty in main function, 
+  //because we just want to test  
+  //whether the generated source code
+  //(IDL file contains struct named as
+  //'a' or 'b') can be compiled.
+
+  return 0;
+}