scchan created this revision. scchan added a reviewer: yaxunl. Herald added a project: All. scchan requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Herald added a project: clang.
D103221 <https://reviews.llvm.org/D103221> changed HIP's default to C++14, removing the driver logic to force it into a different std. Change-Id: I9f5220a7456687039b0bd3b3574f3124d3cc7665 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D134314 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/hip-std.hip Index: clang/test/Driver/hip-std.hip =================================================================== --- clang/test/Driver/hip-std.hip +++ clang/test/Driver/hip-std.hip @@ -3,8 +3,10 @@ // RUN: %clang -### --target=x86_64-unknown-linux-gnu -offload-arch=gfx906 %s \ // RUN: 2>&1 | FileCheck -check-prefixes=DEFAULT %s -// DEFAULT: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}"-std=c++11" -// DEFAULT: "-cc1"{{.*}}"-std=c++11" +// DEFAULT: "-cc1"{{.*}}"-fcuda-is-device"{{.*}} +// DEFAULT-NOT: "-std="{{.*}} +// DEFAULT: "-cc1"{{.*}} +// DEFAULT-NOT: "-std="{{.*}} // RUN: %clang -### --target=x86_64-unknown-linux-gnu -offload-arch=gfx906 %s \ // RUN: -std=c++17 %s 2>&1 | FileCheck -check-prefixes=SPECIFIED %s @@ -13,8 +15,10 @@ // RUN: %clang -### --target=x86_64-pc-windows-msvc -offload-arch=gfx906 %s \ // RUN: 2>&1 | FileCheck -check-prefixes=MSVC-DEF %s -// MSVC-DEF: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}"-std=c++14" -// MSVC-DEF: "-cc1"{{.*}}"-std=c++14" +// MSVC-DEF: "-cc1"{{.*}}"-fcuda-is-device"{{.*}} +// MSVC-DEF-NOT: "-std="{{.*}} +// MSVC-DEF: "-cc1"{{.*}} +// MSVC-DEF-NOT: "-std="{{.*}} // RUN: %clang -### --target=x86_64-pc-windows-msvc -offload-arch=gfx906 %s \ // RUN: -std=c++17 %s 2>&1 | FileCheck -check-prefixes=MSVC-SPEC %s Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -5881,11 +5881,6 @@ Args.AddLastArg(CmdArgs, options::OPT_ftrigraphs, options::OPT_fno_trigraphs); - - // HIP headers has minimum C++ standard requirements. Therefore set the - // default language standard. - if (IsHIP) - CmdArgs.push_back(IsWindowsMSVC ? "-std=c++14" : "-std=c++11"); } // GCC's behavior for -Wwrite-strings is a bit strange:
Index: clang/test/Driver/hip-std.hip =================================================================== --- clang/test/Driver/hip-std.hip +++ clang/test/Driver/hip-std.hip @@ -3,8 +3,10 @@ // RUN: %clang -### --target=x86_64-unknown-linux-gnu -offload-arch=gfx906 %s \ // RUN: 2>&1 | FileCheck -check-prefixes=DEFAULT %s -// DEFAULT: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}"-std=c++11" -// DEFAULT: "-cc1"{{.*}}"-std=c++11" +// DEFAULT: "-cc1"{{.*}}"-fcuda-is-device"{{.*}} +// DEFAULT-NOT: "-std="{{.*}} +// DEFAULT: "-cc1"{{.*}} +// DEFAULT-NOT: "-std="{{.*}} // RUN: %clang -### --target=x86_64-unknown-linux-gnu -offload-arch=gfx906 %s \ // RUN: -std=c++17 %s 2>&1 | FileCheck -check-prefixes=SPECIFIED %s @@ -13,8 +15,10 @@ // RUN: %clang -### --target=x86_64-pc-windows-msvc -offload-arch=gfx906 %s \ // RUN: 2>&1 | FileCheck -check-prefixes=MSVC-DEF %s -// MSVC-DEF: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}"-std=c++14" -// MSVC-DEF: "-cc1"{{.*}}"-std=c++14" +// MSVC-DEF: "-cc1"{{.*}}"-fcuda-is-device"{{.*}} +// MSVC-DEF-NOT: "-std="{{.*}} +// MSVC-DEF: "-cc1"{{.*}} +// MSVC-DEF-NOT: "-std="{{.*}} // RUN: %clang -### --target=x86_64-pc-windows-msvc -offload-arch=gfx906 %s \ // RUN: -std=c++17 %s 2>&1 | FileCheck -check-prefixes=MSVC-SPEC %s Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -5881,11 +5881,6 @@ Args.AddLastArg(CmdArgs, options::OPT_ftrigraphs, options::OPT_fno_trigraphs); - - // HIP headers has minimum C++ standard requirements. Therefore set the - // default language standard. - if (IsHIP) - CmdArgs.push_back(IsWindowsMSVC ? "-std=c++14" : "-std=c++11"); } // GCC's behavior for -Wwrite-strings is a bit strange:
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits