3 ms·
There 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) {
by sorbits 17y ago
There 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