Skip to content

Commit 6fe7de9

Browse files
committed
[Driver] -nostdinc -nostdinc++: don't warn for -Wunused-command-line-argument
1 parent 766d27d commit 6fe7de9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2882,9 +2882,8 @@ void Generic_GCC::AddMultilibIncludeArgs(const ArgList &DriverArgs,
28822882

28832883
void Generic_GCC::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
28842884
ArgStringList &CC1Args) const {
2885-
if (DriverArgs.hasArg(options::OPT_nostdinc) ||
2886-
DriverArgs.hasArg(options::OPT_nostdincxx) ||
2887-
DriverArgs.hasArg(options::OPT_nostdlibinc))
2885+
if (DriverArgs.hasArg(options::OPT_nostdinc, options::OPT_nostdincxx,
2886+
options::OPT_nostdlibinc))
28882887
return;
28892888

28902889
switch (GetCXXStdlibType(DriverArgs)) {

clang/test/Driver/nostdincxx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: not %clangxx -nostdinc %s 2>&1 | FileCheck %s
22
// RUN: not %clangxx -nostdinc++ %s 2>&1 | FileCheck %s
33
// RUN: not %clangxx -nostdlibinc %s 2>&1 | FileCheck %s
4+
// RUN: not %clangxx -fsyntax-only -nostdinc -nostdinc++ %s 2>&1 | FileCheck /dev/null --implicit-check-not=-Wunused-command-line-argument
45
// CHECK: file not found
56
#include <vector>
67

0 commit comments

Comments
 (0)