Question:
a.cpp:Best Answer:
Short answer: This behavior is due to bug 56721 inclang-tidy
.Long answer, based on my comment on that bug:
The bug relates to how
reference
is declared in the container. That in turn causes clang-tidy
to not realize that the return value of the accessor is an instance of a relevant container.The core of
UseEmplaceCheck.cpp
is:clang-query
) will report the non-nested case, as expected:cxxRecordDecl
, and its name is a long template-id. That template-id is derived from the code used to declare std::vector::reference
in the headers. It should be semantically equivalent to std::pair<int, int>
, but that equivalence is evidently obscured from clang-tidy
here.If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review