[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)
Yeoul Na via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 2 12:07:34 PDT 2023
================
@@ -0,0 +1,12 @@
+// This reports a warning to follow the default behavior of ClangAs.
+// RUN: %clang -fexperimental-bounds-safety -x assembler -c %s -o /dev/null 2>&1 | FileCheck -check-prefix WARN %s
+
+
+// WARN: warning: argument unused during compilation: '-fexperimental-bounds-safety'
+
+// expected-no-diagnostics
+// RUN: %clang -fexperimental-bounds-safety -Xclang -verify -c -x c %s -o /dev/null
+// Unlike '-x assembler', '-x assembler-with-cpp' silently ignores unused options by default.
----------------
rapidsna wrote:
@nickdesaulniers The unused warning doesn't appear for `-x assembler-with-cpp` to follow the common behaviors. Instead, I added a note here that we need to add a targeted warning in future when assembler tries to use preprocessor directives to check if bounds safety ie enabled. WDYT?
https://github.com/llvm/llvm-project/pull/70480
More information about the cfe-commits
mailing list