[LLVMbugs] [Bug 14281] New: boost::units::conversion_factor reaches UNREACHABLE "Impossible TemplateArgument"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 7 09:49:26 PST 2012


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

             Bug #: 14281
           Summary: boost::units::conversion_factor reaches UNREACHABLE
                    "Impossible TemplateArgument"
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm+bugs at trds.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Triggering the bug:

#include <iostream>
#include <boost/units/systems/si/plane_angle.hpp>
#include <boost/units/systems/angle/gradians.hpp>
#include <boost/units/conversion.hpp>

int main(int argc, char **argv) {
    using namespace boost::units;
    std::cout << boost::units::conversion_factor(gradian::gradians,si::radians)
<< std::endl;
    return 0;
}

The template stuff in Boost.Units is too heavy for me, I have no idea what the
problem could be. Message from clang was:

Impossible TemplateArgument
UNREACHABLE executed at
/home/ds/devel/llvm/tools/clang/lib/AST/TypeLoc.cpp:325!
0  clang-3.2       0x000000000131a41f
1  clang-3.2       0x000000000131a949
2  libpthread.so.0 0x00002b0802c33cb0
3  libc.so.6       0x00002b080368e425 gsignal + 53
4  libc.so.6       0x00002b0803691b8b abort + 379
5  clang-3.2       0x00000000012e44bc
6  clang-3.2       0x0000000002063878
clang::TemplateSpecializationTypeLoc::initializeArgLocs(clang::ASTContext&,
unsigned int, clang::TemplateArgument const*, clang::TemplateArgumentLocInfo*,
clang::SourceLocation) + 200
7  clang-3.2       0x0000000002063f2b
clang::TypeLoc::initializeImpl(clang::ASTContext&, clang::TypeLoc,
clang::SourceLocation) + 731
8  clang-3.2       0x0000000001f08abe
clang::ASTContext::getTrivialTypeSourceInfo(clang::QualType,
clang::SourceLocation) const + 62
9  clang-3.2       0x0000000001abf820
10 clang-3.2       0x0000000001ac26d9
11 clang-3.2       0x0000000001ac9442
clang::Sema::getMoreSpecializedPartialSpecialization(clang::ClassTemplatePartialSpecializationDecl*,
clang::ClassTemplatePartialSpecializationDecl*, clang::SourceLocation) + 866
12 clang-3.2       0x0000000001afdf90
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) + 1088
13 clang-3.2       0x0000000001b4d65b
clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType,
clang::Sema::TypeDiagnoser&) + 1307
14 clang-3.2       0x000000000184cf61
clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&,
clang::DeclContext*) + 353
15 clang-3.2       0x0000000001a84039
clang::Sema::CheckTypenameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const&, clang::SourceLocation) + 217
16 clang-3.2       0x0000000001b03d69
17 clang-3.2       0x0000000001af8f18
18 clang-3.2       0x0000000001af87a6
19 clang-3.2       0x0000000001af9f60
clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName, clang::CXXRecordDecl*, unsigned int) + 1440
20 clang-3.2       0x0000000001b21828
clang::TemplateDeclInstantiator::SubstFunctionType(clang::FunctionDecl*,
llvm::SmallVectorImpl<clang::ParmVarDecl*>&) + 248
21 clang-3.2       0x0000000001b2770d
clang::TemplateDeclInstantiator::VisitFunctionDecl(clang::FunctionDecl*,
clang::TemplateParameterList*) + 317
22 clang-3.2       0x0000000001b26a37 clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) + 119
23 clang-3.2       0x0000000001ae8788
clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*) + 2328
24 clang-3.2       0x0000000001aeb0b6
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&) + 1046
25 clang-3.2       0x0000000001a3e352
clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*,
clang::DeclAccessPair, clang::TemplateArgumentListInfo*,
llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool) + 386
26 clang-3.2       0x0000000001a3ffbd
clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*,
llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool) + 445
27 clang-3.2       0x0000000001a40236
clang::Sema::buildOverloadedCallSet(clang::Scope*, clang::Expr*,
clang::UnresolvedLookupExpr*, clang::Expr**, unsigned int,
clang::SourceLocation, clang::OverloadCandidateSet*,
clang::ActionResult<clang::Expr*, true>*) + 310
28 clang-3.2       0x0000000001a40b88
clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*,
clang::UnresolvedLookupExpr*, clang::SourceLocation, clang::Expr**, unsigned
int, clang::SourceLocation, clang::Expr*, bool) + 456
29 clang-3.2       0x0000000001990347 clang::Sema::ActOnCallExpr(clang::Scope*,
clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool) + 1383
30 clang-3.2       0x0000000001b1103f
31 clang-3.2       0x0000000001b110b6
32 clang-3.2       0x0000000001b0735a
33 clang-3.2       0x0000000001b11453
34 clang-3.2       0x0000000001b07a3b
35 clang-3.2       0x0000000001b1638d
36 clang-3.2       0x0000000001b077ab
37 clang-3.2       0x0000000001b17517
38 clang-3.2       0x0000000001b18bf1
39 clang-3.2       0x0000000001b176bd
40 clang-3.2       0x0000000001b19e7f clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&) + 79
41 clang-3.2       0x0000000001b2ef63
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 803
42 clang-3.2       0x0000000001b2e921
clang::Sema::PerformPendingInstantiations(bool) + 657
43 clang-3.2       0x0000000001b2eff2
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 946
44 clang-3.2       0x0000000001b2e921
clang::Sema::PerformPendingInstantiations(bool) + 657
45 clang-3.2       0x0000000001b2eff2
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 946
46 clang-3.2       0x0000000001b2e921
clang::Sema::PerformPendingInstantiations(bool) + 657
47 clang-3.2       0x000000000183bdf2 clang::Sema::ActOnEndOfTranslationUnit()
+ 466
48 clang-3.2       0x000000000160c4e6
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 374
49 clang-3.2       0x0000000001603edd clang::ParseAST(clang::Sema&, bool, bool)
+ 509
50 clang-3.2       0x000000000153dd51 clang::FrontendAction::Execute() + 145
51 clang-3.2       0x0000000001521ed4
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 340
52 clang-3.2       0x000000000131d7b6
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1462
53 clang-3.2       0x0000000000617730 cc1_main(char const**, char const**, char
const*, void*) + 1248
54 clang-3.2       0x0000000000615dc3 main + 787
55 libc.so.6       0x00002b080367976d __libc_start_main + 237
56 clang-3.2       0x0000000000612ae9
Stack dump:
0.    Program arguments: /usr/local/bin/clang-3.2 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name test_clang.cpp
-mrelocation-model static -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer
-ffunction-sections -fdata-sections -coverage-file
/home/ds/src/lpr/build-charon-clang/CMakeFiles/test_clang.dir/test/test_clang.cpp.o
-resource-dir /usr/local/bin/../lib/clang/3.2 -isystem
/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -isystem
/usr/include/wx-2.8 -isystem /home/ds/src/lpr/modules/be7a/include -isystem
/home/ds/src/lpr/modules/lmfit/lib -isystem
/home/ds/src/lpr/modules/jsoncpp/include -D _FILE_OFFSET_BITS=64 -D
_LARGE_FILES -D __WXGTK__ -D BOOST_FILESYSTEM_VERSION=3 -D BUILD_TYPE_RELEASE
-D NDEBUG -I /usr/local/include -I /home/ds/src/lpr/libs/peak-linux-driver/lib
-I /home/ds/src/lpr/libs/peak-linux-driver/driver -I
/home/ds/src/lpr/libs/gtest/include -I /home/ds/src/lpr/abstract -I
/home/ds/src/lpr/data -I /home/ds/src/lpr/math -I /home/ds/src/lpr/tools -I
/home/ds/src/lpr/hal -I /home/ds/src/lpr/ppm-transform -I
/home/ds/src/lpr/sensors -I /home/ds/src/lpr/gui -I /home/ds/src/lpr/test
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.2/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O3 -Wall -Werror -Wextra
-Wno-unused-parameter -Wpointer-arith -Wwrite-strings -Wno-gnu
-Wno-c99-extensions -Wno-extra-semi -Wno-variadic-macros -Wno-c++11-extensions
-Wunreachable-code -Wno-error=unreachable-code -Winit-self -Wcast-qual
-pedantic -fconst-strings -fdeprecated-macro -fdebug-compilation-dir
/home/ds/src/lpr/build-charon-clang -ferror-limit 19 -fmessage-length 177
-pthread -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
CMakeFiles/test_clang.dir/test/test_clang.cpp.o -x c++
/home/ds/src/lpr/test/test_clang.cpp 
1.    <eof> parser at end of file
2.    /usr/local/include/boost/units/conversion.hpp:176:1: instantiating
function definition 'conversion_factor'
3.    /usr/local/include/boost/units/detail/conversion_impl.hpp:446:17:
instantiating function definition 'value'
4.    /usr/local/include/boost/units/detail/conversion_impl.hpp:317:21:
instantiating function definition 'value'
clang-3: error: unable to execute command: Aborted (core dumped)
clang-3: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 (trunk 167528)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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