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

Crash in DocumentOutline::traverseDecl() with C++20 concepts #256

Closed
HighCommander4 opened this issue Jan 19, 2020 · 1 comment
Closed

Crash in DocumentOutline::traverseDecl() with C++20 concepts #256

HighCommander4 opened this issue Jan 19, 2020 · 1 comment

Comments

@HighCommander4
Copy link

@HighCommander4 HighCommander4 commented Jan 19, 2020

Using a very recent clang trunk (which includes partial support for C++20 concepts), processing this file with -std=c++2a produces a crash in DocumentOutline::traverseDecl():

template <typename T>
concept C = requires(T t) { t.foo(); };
@HighCommander4
Copy link
Author

@HighCommander4 HighCommander4 commented Jan 19, 2020

Here's a stack trace from a debug build:

 #9 0x00007f465b586bab llvm::isa_impl_cl<clang::NamedDecl, clang::Decl const*>::doit(clang::Decl const*) /home/nr/dev/projects/llvm/src/llvm/include/llvm/Support/Casting.h:106:38
#10 0x00007f465b586b58 llvm::isa_impl_wrap<clang::NamedDecl, clang::Decl const*, clang::Decl const*>::doit(clang::Decl const* const&) /home/nr/dev/projects/llvm/src/llvm/include/llvm/Support/Casting.h:132:5
#11 0x00007f465b586b32 llvm::isa_impl_wrap<clang::NamedDecl, clang::Decl* const, clang::Decl const*>::doit(clang::Decl* const&) /home/nr/dev/projects/llvm/src/llvm/include/llvm/Support/Casting.h:122:5
#12 0x00007f465b586aa5 bool llvm::isa<clang::NamedDecl, clang::Decl*>(clang::Decl* const&) /home/nr/dev/projects/llvm/src/llvm/include/llvm/Support/Casting.h:142:3
#13 0x00007f465b586815 llvm::cast_retty<clang::NamedDecl, clang::Decl*>::ret_type llvm::dyn_cast<clang::NamedDecl, clang::Decl>(clang::Decl*) /home/nr/dev/projects/llvm/src/llvm/include/llvm/Support/Casting.h:343:10
#14 0x00007f465b584b20 clang::clangd::(anonymous namespace)::DocumentOutline::traverseDecl(clang::Decl*, std::vector<clang::clangd::DocumentSymbol, std::allocator<clang::clangd::DocumentSymbol> >&) /home/nr/dev/projects/llvm/src/clang-tools-extra/clangd/FindSymbols.cpp:198:11
#15 0x00007f465b584a98 clang::clangd::(anonymous namespace)::DocumentOutline::build() /home/nr/dev/projects/llvm/src/clang-tools-extra/clangd/FindSymbols.cpp:187:25
#16 0x00007f465b5849e4 clang::clangd::(anonymous namespace)::collectDocSymbols(clang::clangd::ParsedAST&) /home/nr/dev/projects/llvm/src/clang-tools-extra/clangd/FindSymbols.cpp:265:31
#17 0x00007f465b584987 clang::clangd::getDocumentSymbols(clang::clangd::ParsedAST&) /home/nr/dev/projects/llvm/src/clang-tools-extra/clangd/FindSymbols.cpp:270:10
arichardson added a commit to arichardson/llvm-project that referenced this issue Apr 1, 2020
Summary: Fixes clangd/clangd#256

Reviewers: kbobyrev

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73056
github-actions bot pushed a commit to tstellar/llvm-project that referenced this issue Jun 11, 2020
Summary: Fixes clangd/clangd#256

Reviewers: kbobyrev

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73056

(cherry picked from commit fb3d915)
tstellar added a commit to tstellar/llvm-project that referenced this issue Jun 23, 2020
Summary: Fixes clangd/clangd#256

Reviewers: kbobyrev

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73056

(cherry picked from commit fb3d915)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant