http://llvm.org/bugs/show_bug.cgi?id=13500

             Bug #: 13500
           Summary: Wrong type for variable sized array when size comes
                    from Objective-C method invocation
           Product: clang
           Version: 3.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Building the following code using: /usr/bin/clang++ -std=gnu++11 -framework
Foundation test.mm

    #import <Foundation/Foundation.h>

    int main (int argc, char const* argv[])
    {
        NSArray* obj = nil;

        int buf[ [obj count] ];
        int* arr = &buf[0];

        return 0;
    }

Produce this error:

    test.mm:8:17: error: subscripted value is not an array, pointer, or vector
            int* arr = &buf[0];
                        ~~~^~
    1 error generated.

This is using Xcode 4.4 for Mountain Lion:

    Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn)
    Target: x86_64-apple-darwin12.0.0
    Thread model: posix

The same code works with clang 3.2 from trunk (r160101).

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to