LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 14538 - Impossible TemplateArgument
Summary: Impossible TemplateArgument
Status: RESOLVED DUPLICATE of bug 14458
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-07 10:20 PST by Rafael Ávila de Espíndola
Modified: 2016-07-22 10:34 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Ávila de Espíndola 2012-12-07 10:20:20 PST
Given

template <typename T, int I>
struct Value;
template <typename T>
struct Value<T, 0> {
};
template<typename TContainer, unsigned>
struct InternalMap {
};
template<typename T1>
struct Value<InternalMap<T1, 1>, 0 > {
  typedef char  Type;
};
template<typename T1>
typename Value<InternalMap<T1, 1>, 0 >::Type property();
void Test_Property() {
  property<char>();
}

clang -cc1 crashes with

Impossible TemplateArgument
UNREACHABLE executed at /home/espindola/llvm/llvm/tools/clang/lib/AST/TypeLoc.cpp:326!
0  clang           0x0000000001128702
1  clang           0x0000000001128b93
2  libpthread.so.0 0x00007f7150fe5fe0
3  libc.so.6       0x00007f7150442935 gsignal + 53
4  libc.so.6       0x00007f71504440e8 abort + 328
5  clang           0x00000000010fb009 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 457
6  clang           0x0000000001d30041 clang::TemplateSpecializationTypeLoc::initializeArgLocs(clang::ASTContext&, unsigned int, clang::TemplateArgument const*, clang::TemplateArgumentLocInfo*, clang::SourceLocation) + 417
Comment 1 Elias Pipping 2012-12-20 08:59:57 PST
This looks pretty similar to bug #14458.
Comment 2 Elias Pipping 2016-01-22 14:55:12 PST
I cannot reproduce this, even with builds as old as clang-r218999-t2014-10-03_11-52-21-b569 obtained via llvmlab. Can this be closed?
Comment 3 Elias Pipping 2016-07-22 10:34:00 PDT
I believe this has been fixed for a long time.

Can't reproduce it with clang 3.5.2, 3.6.2, 3.7.1, or 3.8.1.

Closing.

*** This bug has been marked as a duplicate of bug 14458 ***