Skip to content

__has_include should not error if unevaluated #134510

@kyuupichan

Description

@kyuupichan

If /tmp/unreadable.cpp is unreadable (e.g. because chmod a-r) then clang gives a fatal error on this conditional. GCC gets this right and is silent only because the __has_include is unevaluated.

#if 0 && __has_include("/tmp/unreadable.cpp")
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions