Issue 155155
Summary [clang] spurious `-Wexit-time-destructors` warning for `thread_local` variable
Labels clang
Assignees
Reporter jy-lefort
    Test case:

```
struct HasDestructor {
    ~HasDestructor () {}
};

static thread_local HasDestructor hasDestructor;
```

Compile with:

```
$ clang++ -Wexit-time-destructors -c test.cxx 
test.cxx:5:35: warning: declaration requires an exit-time destructor [-Wexit-time-destructors]
    5 | static thread_local HasDestructor hasDestructor;
      | ^
1 warning generated.
```

It seems to me that the warning does not make sense for `thread_local` variables (assuming that "exit-time" is meant as "process exit-time" and not "thread exit-time").
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to