-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Expand unresolved type references during template instantiation
- Loading branch information
1 parent
bb3b80c
commit 9f537a3
Showing
4 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// RUN: %cxx -verify -fcheck -ftemplates -dump-symbols %s | %filecheck %s | ||
|
||
namespace std { | ||
using size_t = decltype(sizeof(0)); | ||
|
||
template <typename T> | ||
struct allocator { | ||
template <typename U> | ||
struct rebind { | ||
typedef allocator<U> other; | ||
}; | ||
|
||
auto allocate(size_t n) -> T*; | ||
void deallocate(T* p, size_t n); | ||
}; | ||
} // namespace std | ||
|
||
std::allocator<int>::rebind<char> alloc8; | ||
std::allocator<int>::rebind<short> alloc16; | ||
|
||
// clang-format off | ||
// CHECK:namespace | ||
// CHECK-NEXT: namespace std | ||
// CHECK-NEXT: typealias unsigned long size_t | ||
// CHECK-NEXT: template class allocator | ||
// CHECK-NEXT: parameter typename<0, 0> T | ||
// CHECK-NEXT: template class rebind | ||
// CHECK-NEXT: parameter typename<0, 1> U | ||
// CHECK-NEXT: typealias allocator<U> other | ||
// CHECK-NEXT: function T* allocate(unsigned long) | ||
// CHECK-NEXT: function void deallocate(T*, unsigned long) | ||
// CHECK-NEXT: [specializations] | ||
// CHECK-NEXT: class allocator<int> | ||
// CHECK-NEXT: template class rebind | ||
// CHECK-NEXT: parameter typename<0, 1> U | ||
// CHECK-NEXT: typealias allocator<U> other | ||
// CHECK-NEXT: [specializations] | ||
// CHECK-NEXT: class rebind<char> | ||
// CHECK-NEXT: typealias allocator<U> other | ||
// CHECK-NEXT: class rebind<short> | ||
// CHECK-NEXT: typealias allocator<U> other | ||
// CHECK-NEXT: function int* allocate(unsigned long) | ||
// CHECK-NEXT: function void deallocate(int*, unsigned long) | ||
// CHECK-NEXT: variable std::allocator<int>::rebind<char> alloc8 | ||
// CHECK-NEXT: variable std::allocator<int>::rebind<short> alloc16 |