Skip to content

MSVC warns about use of __has_attribute #1486

@dunhor

Description

@dunhor

Version

No response

Summary

This was brought up on an internal channel. It seems as though #1482 has added use of __has_attribute, but doesn't properly guard its usage. The usage should probably be something more like:

#if defined(__clang__) && defined(__has_attribute)
#if __has_attribute(__lto_visibility_public__)
#define WINRT_IMPL_PUBLIC __attribute__((lto_visibility_public))
#endif
#endif

#ifndef WINRT_IMPL_PUBLIC
#define WINRT_IMPL_PUBLIC
#endif

It might also be worth building tests with /WX to catch such warnings earlier

Reproducible example

Expected behavior

No response

Actual behavior

No response

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions