[LLVMbugs] [Bug 14589] New: Assertion `Loc.isValid() && "point of instantiation must be valid!"' failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 12 13:26:09 PST 2012


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

             Bug #: 14589
           Summary: Assertion `Loc.isValid() && "point of instantiation
                    must be valid!"' failed
           Product: clang
           Version: 3.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: stephan.bergmann.secondary at googlemail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Clang built from recent release_32 branch (rev. 169987) aborts with a failed
assertion for me:

> $ cat test.cc
> template<typename> struct S1 {};
> struct S2 {
>     S2(int = 0);
>     S2(S1<void>);
> };
> template<typename> void f1() { new S2(); }
> void f2() { f1<void>(); }

> $ /data/clang/release_32/inst/bin/clang -cc1 test.cc
> clang: /data/clang/release_32/src/tools/clang/lib/Sema/../../include/clang/AST/DeclTemplate.h:1446: void clang::ClassTemplateSpecializationDecl::setPointOfInstantiation(clang::SourceLocation): Assertion `Loc.isValid() && "point of instantiation must be valid!"' failed.
> 0  clang           0x00000000020a174f
> 1  clang           0x00000000020a1c59
> 2  libpthread.so.0 0x000000377e40f500
> 3  libc.so.6       0x000000377e036285 gsignal + 53
> 4  libc.so.6       0x000000377e037b9b abort + 379
> 5  libc.so.6       0x000000377e02ee9e
> 6  libc.so.6       0x000000377e02ef42
> 7  clang           0x0000000000d795de clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) + 4190
> 8  clang           0x0000000000d7a0dc clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) + 1164
> 9  clang           0x0000000000dc1bb5 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::TypeDiagnoser&) + 1285
> 10 clang           0x0000000000dc1e22 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, unsigned int) + 34
> 11 clang           0x0000000000cca524
> 12 clang           0x0000000000ccb78c
> 13 clang           0x0000000000cbf15b
> 14 clang           0x0000000000cbf2c8
> 15 clang           0x0000000000cc578f clang::Sema::AddOverloadCandidate(clang::FunctionDecl*, clang::DeclAccessPair, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool) + 1039
> 16 clang           0x0000000000c72d4e
> 17 clang           0x0000000000c78c22
> 18 clang           0x0000000000c7c563 clang::InitializationSequence::InitializationSequence(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, clang::Expr**, unsigned int) + 2259
> 19 clang           0x0000000000c4bfe3 clang::Sema::BuildCXXNew(clang::SourceRange, bool, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::SourceRange, clang::QualType, clang::TypeSourceInfo*, clang::Expr*, clang::SourceRange, clang::Expr*, bool) + 4051
> 20 clang           0x0000000000d8c2d0
> 21 clang           0x0000000000d82bea
> 22 clang           0x0000000000d92fd3
> 23 clang           0x0000000000d94559
> 24 clang           0x0000000000d92e85
> 25 clang           0x0000000000d9578f clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) + 79
> 26 clang           0x0000000000da93b0 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool) + 784
> 27 clang           0x0000000000da86f1 clang::Sema::PerformPendingInstantiations(bool) + 609
> 28 clang           0x0000000000ad8e22 clang::Sema::ActOnEndOfTranslationUnit() + 418
> 29 clang           0x0000000000a4dd46 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 374
> 30 clang           0x0000000000a4574d clang::ParseAST(clang::Sema&, bool, bool) + 509
> 31 clang           0x0000000000786449 clang::FrontendAction::Execute() + 153
> 32 clang           0x0000000000769ac8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 344
> 33 clang           0x0000000000751446 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1478
> 34 clang           0x000000000074a338 cc1_main(char const**, char const**, char const*, void*) + 1224
> 35 clang           0x0000000000732d6f main + 719
> 36 libc.so.6       0x000000377e02169d __libc_start_main + 237
> 37 clang           0x0000000000749d0d
> Stack dump:
> 0.	Program arguments: /data/clang/release_32/inst/bin/clang -cc1 test.cc 
> 1.	<eof> parser at end of file
> 2.	test.cc:6:25: instantiating function definition 'f1'
> Aborted

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