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

            Bug ID: 40995
           Summary: Unavailable function incorrectly marked as deleted
                    from within a scoped marked as unavailable
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: ldio...@apple.com
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

Functions marked as unavailable appear as being deleted even when from a scope
that is unavailable too:

    $ cat <<EOF | clang++ -xc++ - -fsyntax-only -std=c++11
    #include <type_traits>

    #define UNAVAILABLE
__attribute__((availability(macosx,strict,introduced=99.99)))

    struct Bar { UNAVAILABLE Bar(int, int) { } };

    struct UNAVAILABLE Foo { 
        // this is performed in a scope marked as unavailable
        static_assert(std::is_constructible<Bar, int, int>::value, ""); // this
fires
    };
    EOF

I think the static_assert fires because the code is equivalent to marking
`Bar(int,int) = delete`, which would then fail the static_assert. However,
since `Bar(int, int)` is used (in std::is_constructible) from a context that is
transitively unavailable (because Foo is unavailable), I would expect `Bar(int,
int)` not to be marked deleted in that context.

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

Reply via email to