[llvm-bugs] [Bug 40995] New: Unavailable function incorrectly marked as deleted from within a scoped marked as unavailable

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 7 12:11:55 PST 2019


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: unassignedclangbugs at nondot.org
          Reporter: ldionne at apple.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190307/70583cb5/attachment.html>


More information about the llvm-bugs mailing list