https://llvm.org/bugs/show_bug.cgi?id=27070
Bug ID: 27070 Summary: clang cannot distinguish declspec(property) of same property name but with different types (T &, T const &) Product: clang Version: 3.8 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Frontend Assignee: unassignedclangb...@nondot.org Reporter: chen...@outlook.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified This happens on clang version 3.8.0-2ubuntu1 (tags/RELEASE_380/final)) on xubuntu 16.04 beta, the code sample and compiler error is as follows. It is a regression, since clang 3.6.2 could build this sample with no issue. Could you please take a look? Thanks. 01 #include <iostream> 02 template <class T> 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<int> foo; 14 print(foo.get_Data()); // compilation passed 15 print(foo.Data); // compilation failed 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<int>::Data' __declspec(property(get=get_Data)) T const& Data; ^ ./foo.cpp:6:44: note: candidate found by name lookup is 'Foo<int>::Data' __declspec(property(get=get_Data)) T & Data; ^ -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs