Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize-use-using assertion #29505

Closed
AaronBallman opened this issue Aug 25, 2016 · 9 comments
Closed

modernize-use-using assertion #29505

AaronBallman opened this issue Aug 25, 2016 · 9 comments
Labels
bugzilla Issues migrated from bugzilla clang-tidy

Comments

@AaronBallman
Copy link
Collaborator

Bugzilla Link 29135
Resolution FIXED
Resolved on Jan 17, 2017 10:14
Version unspecified
OS Windows NT
CC @pepsiman

Extended Description

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

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.

@pepsiman
Copy link
Contributor

*** Bug llvm/llvm-bugzilla-archive#31452 has been marked as a duplicate of this bug. ***

@pepsiman
Copy link
Contributor

*** Bug llvm/llvm-bugzilla-archive#31490 has been marked as a duplicate of this bug. ***

@pepsiman
Copy link
Contributor

bug 31490 has a stack trace.

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 17, 2017

Can someone provide an isolated (and, ideally, reduced) test case?

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 17, 2017

Actually, there's a test case in llvm/llvm-bugzilla-archive#31452

$ 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)

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 17, 2017

A stray cat sneaked into the test case. Here's the actual test:

struct Foo;
#define Bar Baz
typedef Foo Bar;

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 17, 2017

Should be fixed in r292229.

@pepsiman
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#31452

@pepsiman
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#31490

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-tidy
Projects
None yet
Development

No branches or pull requests

3 participants