commit | 87095f7ddeff3038a0cf8e6574922f9c11688619 | [log] [tgz] |
---|---|---|
author | Wang Nan <[email protected]> | Mon Sep 26 07:26:56 2016 +0000 |
committer | Arnaldo Carvalho de Melo <[email protected]> | Wed Oct 05 19:59:35 2016 -0300 |
tree | 73eb2890678d20f32da70d5f373612e03bd6e509 | |
parent | f61bdc3304281e9ff9eec4f1ed9fb15bcf4d8a5e [diff] [blame] |
tools build: Add feature detection for g++ Check if g++ is available. The result will be used by builtin clang and LLVM support. Since LLVM requires C++11, this feature detector checks std::move(). Signed-off-by: Wang Nan <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: He Kuang <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Zefan Li <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
diff --git a/tools/build/feature/test-cxx.cpp b/tools/build/feature/test-cxx.cpp new file mode 100644 index 0000000..b1dee9a3 --- /dev/null +++ b/tools/build/feature/test-cxx.cpp
@@ -0,0 +1,15 @@ +#include <iostream> +#include <memory> + +static void print_str(std::string s) +{ + std::cout << s << std::endl; +} + +int main() +{ + std::string s("Hello World!"); + print_str(std::move(s)); + std::cout << "|" << s << "|" << std::endl; + return 0; +}