No 'aka' in diagnostics about temporary values. #13225
Labels
bugzilla
Issues migrated from bugzilla
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
quality-of-implementation
Extended Description
#include
#include
using namespace std;
size_t test (vector &strings) {
return strings.begin().length();
}
We get this error:
error: no member named 'length' in '__gnu_cxx::__normal_iterator<std::basic_string *, std::vector<std::basic_string, std::allocator<std::basic_string>>>'; did you mean to use '->' instead of '.'?
It'd be nice to say something like:
error: no member named 'length' in 'vector::iterator' (aka '...'); did you mean to use '->' instead of '.'?
i.e. use the spelling in the declaration of vector::begin, scoped to the spelling used to declare 'strings'.
(If it matters, GCC doesn't do any better.)
The text was updated successfully, but these errors were encountered: