1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Try to work around MSVC being buggy. Attempt #1.

error C2971: 'llvm::ManagedStatic': template parameter 'Creator': 'CreateDefaultTimerGroup': a variable with non-static storage duration cannot be used as a non-type argument

llvm-svn: 304157
This commit is contained in:
Benjamin Kramer 2017-05-29 14:28:04 +00:00
parent 8bf13d6351
commit 50f1b689ec
2 changed files with 4 additions and 2 deletions

View File

@ -72,9 +72,11 @@ std::unique_ptr<raw_fd_ostream> llvm::CreateInfoOutputFile() {
return llvm::make_unique<raw_fd_ostream>(2, false); // stderr.
}
static void *CreateDefaultTimerGroup() {
namespace {
void *CreateDefaultTimerGroup() {
return new TimerGroup("misc", "Miscellaneous Ungrouped Timers");
}
} // namespace
static ManagedStatic<TimerGroup, CreateDefaultTimerGroup> DefaultTimerGroup;
static TimerGroup *getDefaultTimerGroup() { return &*DefaultTimerGroup; }

View File

@ -86,7 +86,7 @@ TEST(ManagedStaticTest, NestedStatics) {
} // namespace NestedStatics
namespace CustomCreatorDeletor {
static void *CustomCreate() {
void *CustomCreate() {
void *Mem = std::malloc(sizeof(int));
*((int *)Mem) = 42;
return Mem;