Running the following command causes a failed assertion in Lexer::getSourceLocation because the location passed in to the function is not within the BufferStart and BufferEnd range. clang-tidy -checks=-*,modernize-use-using E:\Desktop\test.cpp -- -std=c++14 I suspect this issue boils down to what includes are in use by the source manager, so my test case requires MSVC 2015. However, the test is quite simple: #include <map> typedef std::map<int, int> m; I do not think this is a clang-tidy bug, but is likely instead a clang frontend bug with the lexer. However, since I can only reproduce this bug through clang-tidy, I am reporting it here.
*** Bug 31452 has been marked as a duplicate of this bug. ***
*** Bug 31490 has been marked as a duplicate of this bug. ***
bug 31490 has a stack trace.
Can someone provide an isolated (and, ideally, reduced) test case?
Actually, there's a test case in http://llvm.org/PR31452 $ cat test.cc cat struct Foo; #define Bar Baz typedef Foo Bar; $ clang-tidy -checks=-*,modernize-use-using test.cc -- -std=c++11 tools/clang/lib/Lex/Lexer.cpp:1079: clang::SourceLocation clang::Lexer::getSourceLocation(const char *, unsigned int) const: Assertion `Loc >= BufferStart && Loc <= BufferEnd && "Location out of range for this buffer!"' failed. Aborted (core dumped)
A stray cat sneaked into the test case. Here's the actual test: struct Foo; #define Bar Baz typedef Foo Bar;
Should be fixed in r292229.