-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support to clang"s windows mangler to handle template argument v…
…alues that are pointers one-past-the-end of a non-array symbol. Also improves error messages in other template argument scenarios where clang bails.
- Loading branch information
1 parent
2f55e55
commit d722361
Showing
2 changed files
with
68 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -emit-llvm -std=c++20 -x c++ < %s | FileCheck -check-prefix=WIN64 %s | ||
|
||
struct A { | ||
const int* ptr; | ||
}; | ||
|
||
template<A> void tfn() {}; | ||
|
||
// WIN64: ??$tfn@$2UA@@PEBH5CE?ints@@3QBHB06@@@@@YAXXZ | ||
constexpr int ints[] = { 1, 2, 7, 8, 9, -17, -10 }; //Note: this does NOT break the unpatched mangler | ||
|
||
// WIN64: ??$tfn@$2UA@@PEBH5E?one_int@@3HB@@@@YAXXZ | ||
constexpr int one_int = 7; | ||
|
||
void template_instance() { | ||
tfn<A{ints + sizeof(ints)/sizeof(int)}>(); | ||
tfn<A{&one_int + 1}>(); | ||
} | ||
|