[LLVMbugs] [Bug 7016] New: Assertion: 'declaration was not instantiated in this scope' in boost code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 2 14:34:18 PDT 2010


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

           Summary: Assertion: 'declaration was not instantiated in this
                    scope' in boost code
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=4800)
 --> (http://llvm.org/bugs/attachment.cgi?id=4800)
Testcase

The attached test case (apologises for the size, if it very hard to debug,
report back, and I shall try my best to reduce it further) comes from a
boost::proto testcase and compiles fine in g++. It produces the following
backtrace.

~/Dropbox$ clang++ declaration_not_instantiated.cc -c -w
Assertion failed: (D->isInvalidDecl() && "declaration was not instantiated in
this scope!"), function getInstantiationOf, file SemaTemplateInstantiate.cpp,
line 1603.
0  clang             0x00f54489 PrintStackTrace(void*) + 45
1  clang             0x00f549d3 SignalHandler(int) + 374
2  libSystem.B.dylib 0x91cc842b _sigtramp + 43
3  libSystem.B.dylib 0xffffffff _sigtramp + 1848867839
4  libSystem.B.dylib 0x91d558e5 raise + 26
5  libSystem.B.dylib 0x91d6b99c abort + 93
6  libSystem.B.dylib 0x91d58544 __pthread_markcancel + 0
7  clang             0x0039f82f
clang::Sema::LocalInstantiationScope::getInstantiationOf(clang::Decl const*) +
249
8  clang             0x003cfd4b
clang::Sema::FindInstantiatedDecl(clang::SourceLocation, clang::NamedDecl*,
clang::MultiLevelTemplateArgumentList const&) + 147
9  clang             0x003a66ea (anonymous
namespace)::TemplateInstantiator::TransformDecl(clang::SourceLocation,
clang::Decl*) + 390
10 clang             0x003bea7a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformDeclRefExpr(clang::DeclRefExpr*) +
342
11 clang             0x003bef02 (anonymous
namespace)::TemplateInstantiator::TransformDeclRefExpr(clang::DeclRefExpr*) +
188
12 clang             0x003a8cb2 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) + 706
13 clang             0x003ae839 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) + 297
14 clang             0x003a90fe clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) + 1806
15 clang             0x003bf039 clang::Sema::SubstExpr(clang::Expr*,
clang::MultiLevelTemplateArgumentList const&) + 165
16 clang             0x003d4212 InstantiateInitializer(clang::Sema&,
clang::Expr*, clang::MultiLevelTemplateArgumentList const&,
clang::SourceLocation&, llvm::SmallVector<clang::SourceLocation, 4u>&,
clang::ASTOwningVector<&(clang::ActionBase::DeleteExpr(void*)), 8u>&,
clang::SourceLocation&) + 579
17 clang             0x003d4b54 (anonymous
namespace)::TemplateDeclInstantiator::VisitVarDecl(clang::VarDecl*) + 1124
18 clang             0x003d590c clang::DeclVisitor<(anonymous
namespace)::TemplateDeclInstantiator, clang::Decl*>::Visit(clang::Decl*) + 870
19 clang             0x003d6f37 clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) + 71
20 clang             0x003a5f56 (anonymous
namespace)::TemplateInstantiator::TransformDefinition(clang::SourceLocation,
clang::Decl*) + 58
21 clang             0x003a6000 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformDeclStmt(clang::DeclStmt*) + 100
22 clang             0x003a7ea2 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 2108
23 clang             0x003a8533 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) + 115
24 clang             0x003bf0a3 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
+ 53
25 clang             0x003a792a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 708
26 clang             0x003c2ad9 clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&) + 165
27 clang             0x003d7b49
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 1213
28 clang             0x003d74ba
clang::Sema::PerformPendingImplicitInstantiations(bool) + 328
29 clang             0x003d7cc4
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 1592
30 clang             0x003d74ba
clang::Sema::PerformPendingImplicitInstantiations(bool) + 328
31 clang             0x003d7cc4
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 1592
32 clang             0x003d74ba
clang::Sema::PerformPendingImplicitInstantiations(bool) + 328
33 clang             0x003d7cc4
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 1592
34 clang             0x003d74ba
clang::Sema::PerformPendingImplicitInstantiations(bool) + 328
35 clang             0x00240b89 clang::Sema::ActOnEndOfTranslationUnit() + 37
36 clang             0x0061322b
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<1>&) + 77
37 clang             0x0023ff35 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 426
38 clang             0x00063d6f clang::ASTFrontendAction::ExecuteAction() + 269
39 clang             0x00063e8c clang::FrontendAction::Execute() + 278
40 clang             0x00047ea3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
41 clang             0x0002ab7f cc1_main(char const**, char const**, char
const*, void*) + 1979
42 clang             0x0002eaa5 main + 272
43 clang             0x000298bd start + 53
Stack dump:
0.    Program arguments: /usr/local/bin/clang -cc1 -triple
i386-apple-darwin10.0.0 -S -disable-free -main-file-name
declaration_not_instantiated.cc -pic-level 1 -mdisable-fp-elim -target-cpu
yonah -resource-dir /usr/local/lib/clang/2.0 -w -ferror-limit 19
-ftemplate-backtrace-limit 10 -fmessage-length 129 -stack-protector 1 -fblocks
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/M8/M86fCFVgGQ0r-V2oY5lLC++++TI/-Tmp-/cc-QWMM6y.s -x c++
declaration_not_instantiated.cc 
1.    <eof> parser at end of file
2.    declaration_not_instantiated.cc:218:14: instantiating function definition
'boost::xpressive::detail::xpression_adaptor<boost::xpressive::detail::static_xpression<boost::xpressive::detail::regex_byref_matcher<int>,
boost::xpressive::detail::static_xpression<boost::xpressive::detail::regex_byref_matcher<int>,
int> >, boost::xpressive::detail::matchable_ex<int> >::match'
3.    declaration_not_instantiated.cc:315:34: instantiating function definition
'boost::xpressive::detail::static_xpression<boost::xpressive::detail::regex_byref_matcher<int>,
boost::xpressive::detail::static_xpression<boost::xpressive::detail::regex_byref_matcher<int>,
int> >::match'
4.    declaration_not_instantiated.cc:231:30: instantiating function definition
'boost::xpressive::detail::regex_byref_matcher<int>::match'
5.    declaration_not_instantiated.cc:208:39: instantiating function definition
'boost::xpressive::detail::push_context_match'
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)
~/Dropbox$

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