[cfe-dev] ARC + goto into protected scope error

Dave Keck davekeck at gmail.com
Thu Aug 16 18:47:47 PDT 2012


Hi all,

I use the "check for success/goto failed" pattern everywhere, but
Clang refuses to compile such code with ARC enabled if the goto
bypasses a variable declaration (giving a "goto into protected scope"
error.)

Is this something that's likely to be fixed? Compiling the program
below triggers the error.

    // compile with: clang -framework Foundation -fobjc-arc <file>.m
    #import <Foundation/Foundation.h>
    int main() {
        goto cleanup;
        NSString *str;
        cleanup:
        return 0;
    }



More information about the cfe-dev mailing list