Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
test.thrift file is as below:
struct a
struct b
{ 1: i8 size, 2: i32 seq }struct a1
{ 1: i8 size, 2: i32 seq }struct a2
{ 1: i8 size, 2: i32 seq }When struct is named as 'a' or 'b' will throw compile errors as below:
In file included from test_constants.h:10:0,
from test_constants.cpp:7:
test_types.h:76:17: error: ‘a’ is not a type
void swap(a &a, a &b);
^
In file included from test_types.cpp:7:0:
test_types.h:76:17: error: ‘a’ is not a type
void swap(a &a, a &b);
^
test_types.cpp:102:17: error: ‘a’ is not a type
void swap(a &a, a &b) {
^
test_types.cpp: In function ‘void swap(a&, int&)’:
test_types.cpp:104:18: error: request for member ‘name’ in ‘b’, which is of non-class type ‘int’
swap(a.name, b.name);
^~~~
test_types.cpp:105:19: error: request for member ‘price’ in ‘b’, which is of non-class type ‘int’
swap(a.price, b.price);
^~~~~
test_types.cpp:106:21: error: request for member ‘__isset’ in ‘b’, which is of non-class type ‘int’
swap(a._isset, b._isset);
^~~~~~~
Attachments
Issue Links
- links to