================
@@ -0,0 +1,45 @@
+// REQUIRES: system-linux
+//
+// RUN: rm -rf %t && mkdir %t
+// RUN: split-file %s %t
+//
+// Build the module first:
+// RUN: clang++ -std=c++20 -x c++-module --precompile %t/mymodule.cppm -o
%t/mymodule.pcm -I%t -fPIC
+//
+// Run clang-tidy on main.cpp which both includes the header and imports the
module.
+// This should NOT produce any warnings or fix conflicts for implicit
destructors.
+// The struct X has no user-declared destructor, only an implicit one.
+// RUN: clang-tidy %t/main.cpp -checks='-*,performance-trivially-destructible'
\
+// RUN: -- -std=c++20 -I%t -fmodule-file=mymodule=%t/mymodule.pcm 2>&1 \
+// RUN: | FileCheck %s --allow-empty
+//
+// CHECK-NOT: warning:
+// CHECK-NOT: Fix conflicts with existing fix
+
+//--- header.h
+#pragma once
+#include <atomic>
+
+// A struct with an implicit destructor and an atomic member.
+// With C++20 modules, when this header is included in both the global module
+// fragment and directly in a file that imports the module, the implicit
+// destructor can appear multiple times in the redeclaration chain.
+// The check should NOT match implicit destructors.
+struct X {
+ X() : a(0) {}
+ std::atomic<int> a;
----------------
localspook wrote:
Is the `a` variable and the `<atomic>` include necessary?
https://github.com/llvm/llvm-project/pull/178471
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits