mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 05:26:06 +00:00

Close https://github.com/llvm/llvm-project/issues/79240 Cite the comment from @mizvekov in //github.com/llvm/llvm-project/issues/79240: > There are two kinds of bugs / issues relevant here: > > Clang bugs that this change hides > Here we can add a Frontend flag that disables the GMF ODR check, just > so > we can keep tracking, testing and fixing these issues. > The Driver would just always pass that flag. > We could add that flag in this current issue. > Bugs in user code: > I don't think it's worth adding a corresponding Driver flag for > controlling the above Frontend flag, since we intend it's behavior to > become default as we fix the problems, and users interested in testing > the more strict behavior can just use the Frontend flag directly. This patch follows the suggestion: - Introduce the CC1 flag `-fskip-odr-check-in-gmf` which is by default off, so that the every existing test will still be tested with checking ODR violations. - Passing `-fskip-odr-check-in-gmf` in the driver to keep the behavior we intended. - Edit the document to tell the users who are still interested in more strict checks can use `-Xclang -fno-skip-odr-check-in-gmf` to get the existing behavior.
11 lines
536 B
C++
11 lines
536 B
C++
// RUN: %clang -std=c++20 -### -c %s 2>&1 | FileCheck %s
|
|
// RUN: %clang -std=c++20 -fno-skip-odr-check-in-gmf -### -c %s 2>&1 \
|
|
// RUN: | FileCheck %s --check-prefix=UNUSED
|
|
// RUN: %clang -std=c++20 -Xclang -fno-skip-odr-check-in-gmf -### -c %s 2>&1 \
|
|
// RUN: | FileCheck %s --check-prefix=NO-SKIP
|
|
|
|
// CHECK: -fskip-odr-check-in-gmf
|
|
// UNUSED: warning: argument unused during compilation: '-fno-skip-odr-check-in-gmf'
|
|
// UNUSED-NOT: -fno-skip-odr-check-in-gmf
|
|
// NO-SKIP: -fskip-odr-check-in-gmf{{.*}}-fno-skip-odr-check-in-gmf
|