First of all, sorry for this report, it looks like a nasty bug and I can't give you a simple reproducer (closed source and stripped-down example just works fine).
I'm performing the following calls on a highly templated with many inheritance code:
size += static_cast<std::vector<pairN>>(_ref.A::_map)[j].second.size(); size += _ref.A::_map[j].second.size();
The first line compiles fine, the second does not, with the following error message:
error: no operator "" matches these operands
operand types are: const vectorN [ unsigned short ]
size += _ref.A::_map[j].second.size();
typedef std::pair<unsigned short, std::vector<int>> pairN; typedef std::vector<pairN> vectorN;
Of course, I don't have any problem with clang++ or g++. Any ideas ? Why on earth should I have to cast _ref.A::_map to its own type ?