[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Fri May 16 10:26:08 PDT 2025


================
@@ -26,14 +26,18 @@ void no_get_1() {
     auto [a0, a1] = A(); // expected-error {{decomposes into 3 elements}}
     auto [b0, b1] = B(); // expected-error {{decomposes into 3 elements}}
   }
-  auto [a0, a1, a2] = A(); // expected-error {{undeclared identifier 'get'}} expected-note {{in implicit initialization of binding declaration 'a0'}}
+  auto [a0, a1, a2] = A(); // expected-error {{undeclared identifier 'get'}} \
+                           // expected-note {{perhaps `#include <ranges>` is needed?}} \
----------------
shafik wrote:

Yeah, this does not seem helpful, it feels actively harmful actually.

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


More information about the cfe-commits mailing list