[llvm-bugs] [Bug 25636] New: MSVC __declspec(property) - Indexed accessor property not supported correctly (clang 4.2.1)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 25 07:46:01 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25636

            Bug ID: 25636
           Summary: MSVC __declspec(property) - Indexed accessor property
                    not supported correctly (clang 4.2.1)
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dsim at smallscript.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Indexed accessor property not supported correctly
in clang "4.2.1 Compatible Clang 3.8.0 (trunk)"
-------------------------------------------------
//  See: https://msdn.microsoft.com/en-us/library/yhfk0thd.aspx
//  __declspec(property(get=GetX, put=PutX)) int x[];
//  The above statement indicates that x[] can be used with one or more 
//  array indices. In this case, i=p->x[a][b] will be turned into 
//  i=p->GetX(a, b), and p->x[a][b] = i will be turned into p->PutX(a, b, i);

Output from MSVC is as follows:
1>------ Rebuild All started: Project: LlvmMsVcProperties, Configuration: Debug
Win32 ------
1>  LlvmMsVcProperties.cpp
1>  LlvmMsVcProperties.vcxproj -> LlvmMsVcProperties.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
< PropertyTest::PropertyTest(10)
>x=10
>this->Y[1]             : 1
>this->Y[2][3]          : 6
< set_a_y   as Y[4]=5   : 20
>this->Y[4]=5           : 20
< set_a_b_y as Y[6][7]=8: 336
>this->Y[6][7]=8        : 336
=================================================
=================================================
clang/clang-cl version: ...
#define __VERSION__ "4.2.1 Compatible Clang 3.8.0 (trunk)"
  -fms-compatibility

REPORTS:
lvmMsVcProperties.cpp(32,56): error : no matching member function for call to
'get_index_y'
        printf(">this->Y[1]             : %d\n", this->Y[1]);
                                                 ~~~~~~^
LlvmMsVcProperties.cpp(13,9) :  note: candidate function not viable: requires
single argument 'a', but no arguments were provided
    int get_index_y(int a) { return a; }
        ^
LlvmMsVcProperties.cpp(14,9) :  note: candidate function not viable: requires 2
arguments, but 0 were provided
    int get_index_y(int a, int b) { return a*b; }
        ^
lvmMsVcProperties.cpp(33,56): error : no matching member function for call to
'get_index_y'
        printf(">this->Y[2][3]          : %d\n", this->Y[2][3]);
                                                 ~~~~~~^
LlvmMsVcProperties.cpp(13,9) :  note: candidate function not viable: requires
single argument 'a', but no arguments were provided
    int get_index_y(int a) { return a; }
        ^
LlvmMsVcProperties.cpp(14,9) :  note: candidate function not viable: requires 2
arguments, but 0 were provided
    int get_index_y(int a, int b) { return a*b; }
        ^
lvmMsVcProperties.cpp(34,57): error : no matching member function for call to
'get_index_y'
        printf(">this->Y[4]=5           : %d\n", (this->Y[4]=5));
                                                  ~~~~~~^
LlvmMsVcProperties.cpp(13,9) :  note: candidate function not viable: requires
single argument 'a', but no arguments were provided
    int get_index_y(int a) { return a; }
        ^
LlvmMsVcProperties.cpp(14,9) :  note: candidate function not viable: requires 2
arguments, but 0 were provided
    int get_index_y(int a, int b) { return a*b; }
        ^
lvmMsVcProperties.cpp(35,57): error : no matching member function for call to
'get_index_y'
        printf(">this->Y[6][7]=8        : %d\n", (this->Y[6][7]=8));
                                                  ~~~~~~^
LlvmMsVcProperties.cpp(13,9) :  note: candidate function not viable: requires
single argument 'a', but no arguments were provided
    int get_index_y(int a) { return a; }
        ^
LlvmMsVcProperties.cpp(14,9) :  note: candidate function not viable: requires 2
arguments, but 0 were provided
    int get_index_y(int a, int b) { return a*b; }
        ^
4 errors generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151125/ce6d65a2/attachment.html>


More information about the llvm-bugs mailing list