[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 14:47:29 PST 2024


================
@@ -71,12 +76,17 @@ struct A {
 #endif
   }
   ~A() {
-    clang_analyzer_dump(__func__);
-    clang_analyzer_dump(__FUNCTION__);
-    clang_analyzer_dump(__PRETTY_FUNCTION__);
-    // expected-warning at -3 {{&Element{"~A",0 S64b,char}}}
-    // expected-warning at -3 {{&Element{"~A",0 S64b,char}}}
-    // expected-warning at -3 {{&Element{"A::~A()",0 S64b,char}}}
+#ifdef ANALYZER_MS
+    clang_analyzer_dump(__func__);          // expected-warning {{&Element{"~A",0 S64b,char}}}
+#else
+    clang_analyzer_dump(__func__);          // expected-warning {{&Element{"~A",0 S64b,char}}}
+#endif
----------------
Sirraide wrote:

```suggestion
    clang_analyzer_dump(__func__);          // expected-warning {{&Element{"~A",0 S64b,char}}}
```
As above

https://github.com/llvm/llvm-project/pull/84014


More information about the cfe-commits mailing list