[LLVMbugs] [Bug 8416] New: Assert: Declaration context must already be complete!

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Oct 19 11:09:36 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8416

           Summary: Assert: Declaration context must already be complete!
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: alexei.svitkine at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


When compiling the following (reduced) test case:


#include <stddef.h>

template <class T> class Bazz { };
template <class T> class Bam { friend void * Bazz<T>::operator new(size_t,
Bam<T>&); };
class Foo;
class Bar { Bam<Foo> bamFoo; };

clang++ asserts:

clang: SemaLookup.cpp:1275: bool
clang::Sema::LookupQualifiedName(clang::LookupResult&, clang::DeclContext*,
bool): Assertion `(!isa<TagDecl>(LookupCtx) || LookupCtx->isDependentContext()
|| cast<TagDecl>(LookupCtx)->isDefinition() ||
Context.getTypeDeclType(cast<TagDecl>(LookupCtx))->getAs<TagType>()
->isBeingDefined()) && "Declaration context must already be complete!"' failed.
0  clang           0x000000000190d4cf
1  clang           0x000000000190e1e7
2  libpthread.so.0 0x0000003d5ac0eb10
3  libc.so.6       0x0000003d5a030265 gsignal + 53
4  libc.so.6       0x0000003d5a031d10 abort + 272
5  libc.so.6       0x0000003d5a0296e6 __assert_fail + 246
6  clang           0x0000000000ae02b2
clang::Sema::LookupQualifiedName(clang::LookupResult&, clang::DeclContext*,
bool) + 658
7  clang           0x0000000000ba2208
8  clang           0x0000000000ba48ff
9  clang           0x0000000000ba9139
10 clang           0x0000000000ba5176
11 clang           0x0000000000ba7992 clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) + 34
12 clang           0x0000000000b97a2a
clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*,
clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind, bool) + 602
13 clang           0x0000000000b98de0
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) + 2416
14 clang           0x0000000000bb0b69
clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType,
clang::PartialDiagnostic const&, std::pair<clang::SourceLocation,
clang::PartialDiagnostic>) + 1337
15 clang           0x0000000000bb0d57
clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType,
unsigned int) + 87
16 clang           0x0000000000a05e7b
clang::Sema::CheckFieldDecl(clang::DeclarationName, clang::QualType,
clang::TypeSourceInfo*, clang::RecordDecl*, clang::SourceLocation, bool,
clang::Expr*, clang::SourceLocation, clang::AccessSpecifier, clang::NamedDecl*,
clang::Declarator*) + 507
17 clang           0x0000000000a067f3 clang::Sema::HandleField(clang::Scope*,
clang::RecordDecl*, clang::SourceLocation, clang::Declarator&, clang::Expr*,
clang::AccessSpecifier) + 611
18 clang           0x0000000000a29e28
clang::Sema::ActOnCXXMemberDeclarator(clang::Scope*, clang::AccessSpecifier,
clang::Declarator&, clang::ASTMultiPtr<clang::TemplateParameterList*>,
clang::Expr*, clang::Expr*, bool, bool) + 1544
19 clang           0x000000000094f54e
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject*) + 3614
20 clang           0x00000000009538a7
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::Decl*) + 2199
21 clang           0x0000000000954f45
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 5253
22 clang           0x0000000000941fc1
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 4193
23 clang           0x00000000009352e5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AttributeList*, clang::AccessSpecifier) + 149
24 clang           0x00000000009356f0
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::AttributeList*,
clang::AccessSpecifier) + 336
25 clang           0x0000000000937d95
clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList,
clang::Parser::ParsingDeclSpec*) + 245
26 clang           0x0000000000938623
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 131
27 clang           0x0000000000919ce4 clang::ParseAST(clang::Sema&, bool) + 148
28 clang           0x00000000007a90a2 clang::CodeGenAction::ExecuteAction() +
66
29 clang           0x000000000068fa5e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 350
30 clang           0x000000000066be0f
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1071
31 clang           0x00000000006645f2 cc1_main(char const**, char const**, char
const*, void*) + 482
32 clang           0x000000000066b2a5 main + 4581
33 libc.so.6       0x0000003d5a01d994 __libc_start_main + 244
34 clang           0x0000000000662e49

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list