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

            Bug ID: 50310
           Summary: Duplicate -Wunguarded-availability warnings on nested
                    classes when if(@available) is present
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

The presence of an if(@available) check in a function body can cause duplicate
-Wunguarded-availability warnings to be produced on members of nested classes
in that same function body:

// clang -cc1 -xobjective-c++ -triple x86_64-apple-macosx10.9
-Wunguarded-availability -fblocks -fsyntax-only

typedef int __attribute__((availability(macos, introduced = 10.12))) new_int;
void foo() {
    struct local {
        new_int x; // two -Wunguarded-availability warnings produced on this
line
    };

    if (@available(macos 10.12, *)) {}
}

Removing the if(@available) check below the struct causes only one warning to
be produced, as expected.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to