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

compiler crash with forward declarations and templates #8877

Closed
llvmbot opened this issue Oct 29, 2010 · 2 comments
Closed

compiler crash with forward declarations and templates #8877

llvmbot opened this issue Oct 29, 2010 · 2 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 29, 2010

Bugzilla Link 8505
Resolution FIXED
Resolved on Nov 03, 2010 22:19
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @akyrtzi,@tkremenek

Extended Description

The following code will crash clang trunk (r117648):

template class A {
class B* g;
};
class B {
void f () {}
};
template class A<0>;

Output:
clang: /home/steffen/prog/llvm/tools/clang/lib/Sema/../../include/clang/AST/DependentDiagnostic.h:178: clang::DeclContext::ddiag_iterator clang::DeclContext::ddiag_begin() const: Assertion `isDependentContext() && "cannot iterate dependent diagnostics of non-dependent context"' failed.

Adding "class B;" at the start of the source file will fix the problem.

@tkremenek
Copy link
Contributor

also cloned to rdar://problem/8611125

@akyrtzi
Copy link
Contributor

akyrtzi commented Nov 4, 2010

Fixed at r118235.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 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:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

3 participants