================
@@ -847,6 +847,20 @@ TEST_F(InterpolateTest, Language) {
"clang -D dir/aux.cpp -x objective-c++-header -std=c++17");
}
+TEST_F(InterpolateTest, StdTransferSameFamily) {
+ // ObjC++ → C++ header: same standard family, -std should survive.
+ add("dir/foo.mm", "-std=c++20");
+ EXPECT_EQ(getCommand("dir/foo.hh"), "clang -D dir/foo.mm -std=c++20");
+
+ // Explicit -x objective-c++ on .cpp → C++ header: same family.
+ add("dir/bar.cpp", "-x objective-c++ -std=c++20");
+ EXPECT_EQ(getCommand("dir/bar.hh"), "clang -D dir/bar.cpp -std=c++20");
----------------
HighCommander4 wrote:
It's pretty common for C++ code to use just a plain `.h` extension, could we
add a test case for that as well?
https://github.com/llvm/llvm-project/pull/184560
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits