Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "[clang][deps] During scanning don't emit warnings-as-errors t…
…hat are ignored with diagnostic pragmas." This reverts commit 2f8ac18. After committing a fix for previous buildbot failures in D138970, re-landing the original change.
- Loading branch information
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Test scanning deps does not have more errors than the regular compilation. | ||
|
||
// RUN: rm -rf %t | ||
// RUN: split-file %s %t | ||
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json | ||
|
||
// Check the regular compilation does not fail. | ||
// RUN: %clang -fsyntax-only %t/test.c -I %t/include -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -Wnon-modular-include-in-module -Werror=non-modular-include-in-module | ||
|
||
// And now scanning deps should succeed too. | ||
// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 | ||
|
||
//--- cdb.json.template | ||
[ | ||
{ | ||
"directory": "DIR", | ||
"command": "clang -fsyntax-only DIR/test.c -I DIR/include -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache -Wnon-modular-include-in-module -Werror=non-modular-include-in-module", | ||
"file": "DIR/test.c" | ||
}, | ||
] | ||
|
||
//--- include/nonmodular.h | ||
// empty | ||
|
||
//--- include/modular-includer.h | ||
#pragma clang diagnostic push | ||
#pragma clang diagnostic ignored "-Wnon-modular-include-in-module" | ||
#include <nonmodular.h> | ||
#pragma clang diagnostic pop | ||
|
||
//--- include/module.modulemap | ||
module ModularIncluder { header "modular-includer.h" } | ||
|
||
//--- test.c | ||
#include <modular-includer.h> |