Hi, I am using clang (clang version 3.8.0-+rc2-1~exp1ubuntu2 (tags/RELEASE_380/rc2)) on xubuntu 16.04 beta1 to build my project, and met an issue as follows. It seems like a regression, since we have been using clang 3.6.2 to build our project with no issue, and this sample code could build successfully with clang 3.6.2. Could you help take a look? Thanks.
01 #include
02 template class Foo {
03 public:
04 _declspec(property(get=get_Data)) T const& Data;
05 T const& get_Data() const { return data; }
06 declspec(property(get=get_Data)) T & Data;
07 T & get_Data() { return data; }
08 private:
09 T data;
10 };
11 void print(int const & val){ std::cout << val; }
12 int main(int argc, char** argv) {
13 Foo foo;
14 print(foo.get_Data());
15 print(foo.Data);
16 }
./foo.cpp:15:15: error: reference to ‘Data’ is ambiguous
print(foo.Data);
^
./foo.cpp:4:49: note: candidate found by name lookup is ‘Foo::Data’
__declspec(property(get=get_Data)) T const& Data;
^
./foo.cpp:6:44: note: candidate found by name lookup is ‘Foo::Data’
__declspec(property(get=get_Data)) T & Data;
^