[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 02:20:06 PDT 2024


================
@@ -758,16 +759,18 @@ namespace cwg347 { // cwg347: yes
     void g();
   };
 
-  struct derived : base {};
+  struct derived : base {}; // #defined-here-derived
 
   struct derived::nested {};
   // expected-error at -1 {{no struct named 'nested' in 'cwg347::derived'}}
   int derived::n;
   // expected-error at -1 {{no member named 'n' in 'cwg347::derived'}}
   void derived::f() {}
   // expected-error at -1 {{out-of-line definition of 'f' does not match any declaration in 'cwg347::derived'}}
+  // expected-note@#defined-here-derived {{defined here}}
----------------
Endilll wrote:

```suggestion
  //   expected-note@#cwg347-derived {{defined here}}
```

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


More information about the cfe-commits mailing list