-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
enhancementSomething can be improvedSomething can be improvedfixedSomething works now, yay!Something works now, yay!
Description
I've implemented __builtin_FUNCSIG in Clang recently (llvm/llvm-project@78d8312):
const char* __builtin_FUNCSIG();We should use this builtin in source_location implementation after VS gets Clang 17:
Lines 28 to 32 in a621095
| #if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-10199227 and LLVM-58951 | |
| const char* const _Function_ = __builtin_FUNCTION() | |
| #else // ^^^ workaround / no workaround vvv | |
| const char* const _Function_ = __builtin_FUNCSIG() | |
| #endif // TRANSITION, DevCom-10199227 and LLVM-58951 |
Comparison:
// https://godbolt.org/z/zq6v9v87q
#include <iostream>
void f(const char* old_ = __builtin_FUNCTION(), const char* new_ = __builtin_FUNCSIG()) {
std::cout << "old: " << old_ << "\nnew: " << new_ << '\n';
}
int main() {
f();
}old: main
new: int __cdecl main(void)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementSomething can be improvedSomething can be improvedfixedSomething works now, yay!Something works now, yay!