5 ms·
Very cool in general, though I think it might take me a while to get used to compiler messages of the form "...maybe you meant <suggestion>?". The extra effort
by 1amzave 17y ago
Very cool in general, though I think it might take me a while to get used to compiler messages of the form "...maybe you meant <suggestion>?". The extra effort in checking things is certainly appreciated, it's really just the phrasing that I find odd -- personal pronouns are a little too "word-processor-ish", if that makes any sense (it just doesn't sound like something I expect to hear from a C compiler, really). I might find it less jarring if it were phrased as "...(suggestion: <suggestion>)" instead, or even just without the "you meant".
- dhotson 17y agoI think the google style phrasing 'Did you mean: xx' works pretty well.
- sorbits 17y agoThere already is a few examples of gcc giving helpful hints (although nothing like LLVM). For example (t.cc): template <typename C> void test (C c) { C::iterator it = begin(); } ⋮ test(std::vector<int>()); Shows this error (with a note about what the programmer likely meant): t.cc: In function ‘void test(C)’: t.cc:2: error: expected `;' before ‘it’ t.cc: In function ‘void test(C) [with C = std::vector<int, std::allocator<int> >]’: t.cc:7: instantiated from here t.cc:2: error: dependent-name ‘C::iterator’ is parsed as a non-type, but instantiation yields a type t.cc:2: note: say ‘typename C::iterator’ if a type is meant