[PATCH] D48297: [Darwin] Add a warning for missing include path for libstdc++
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 19 10:48:48 PDT 2018
arphaman marked 3 inline comments as done.
arphaman added inline comments.
================
Comment at: lib/Frontend/InitHeaderSearch.cpp:374-377
+ IsBaseFound = AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",
+ "powerpc-apple-darwin10", "",
+ "ppc64", triple);
+ IsBaseFound &= AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",
----------------
vsapsai wrote:
> Why are you using `&=` here instead of `|=`? I haven't tested but I expect that either 4.2.1 will work or 4.0.0, you don't need both of them.
Good catch, fixed.
================
Comment at: lib/Frontend/InitHeaderSearch.cpp:404
}
+ if (!IsBaseFound && !LangOpts.CUDA)
+ Headers.getDiags().Report(SourceLocation(),
----------------
vsapsai wrote:
> What is so special about CUDA? Is it OK to emit the warning for OpenCL, for instance?
We're looking to warn for pure C++/ObjC++, so I will disable it for other language dialects.
================
Comment at: test/Frontend/warning-stdlibcxx-darwin.cpp:1-2
+// RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist %s 2>&1 | FileCheck %s
+// CHECK: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead
----------------
vsapsai wrote:
> Do you think there is a value in adding a test that does exactly what the warning suggests and verifies there are no warnings?
Good call.
Repository:
rC Clang
https://reviews.llvm.org/D48297
More information about the cfe-commits
mailing list