Skip to content

Clang should warn when building with -fexperimental-bounds-safety and -x assembler-with-cpp #71206

Open
@delcypher

Description

@delcypher

In #70480 the -fexperimental-bounds-safety flag was added.

Currently Clang will emit a warning that -fexperimental-bounds-safety is ignored when building with -x assembler. However, it won't emit a warning when building with -x assembler-with-cpp.

This issue tracks adding a warning to detect when -fexperimental-bounds-safety is used with -x assembler-with-cpp.

We can either have a generic warning whenever this combination of flags are used. Or we could have a more targeted warning:

E.g.

#if __has_feature(bounds_safety) // Should warn here
mov x0, #42
#else
#error "oh no"
#endif

rdar://117917700

Metadata

Metadata

Labels

clang:bounds-safetyIssue/PR relating to the experimental -fbounds-safety feature in Clangclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions