This fixes PR21718.
Details
Diff Detail
Event Timeline
Nice!
I think the patch description could be a little more explanatory, maybe something like "don't mark constexpr members of dllexport classes referenced, since they considered are referenced already".
| lib/Sema/SemaDeclCXX.cpp | ||
|---|---|---|
| 4745 | The comment is a little vague (and should end with a period). Maybe something like "constexpr functions are already marked referenced." Also, David pointed out that this does not only apply to user-defined functions, so it should be moved back to where you first suggested in the PR. Sorry for my misleading suggestion here before. | |
| test/CodeGenCXX/dllexport.cpp | ||
| 621 | Nit: the template is declared as a struct, so it should be referenced as a struct when instantiated too. Please also add a test where the constructor is explicitly defaulted, i.e. template <typename> struct P { constexpr P() = default; }; | |
| lib/Sema/SemaDeclCXX.cpp | ||
|---|---|---|
| 4745 | What about http://llvm.org/bugs/show_bug.cgi?id=21718#c6? | |
Sorry, it seems I'm reading email in the wrong order today.
| lib/Sema/SemaDeclCXX.cpp | ||
|---|---|---|
| 4745 | Maybe what we should do is something like if (MD->isReferenced()) continue; Would that pass all the old tests and your new one? | |
| lib/Sema/SemaDeclCXX.cpp | ||
|---|---|---|
| 4745 | That doesn't fix the original issue. | |
The comment is a little vague (and should end with a period). Maybe something like "constexpr functions are already marked referenced."
Also, David pointed out that this does not only apply to user-defined functions, so it should be moved back to where you first suggested in the PR. Sorry for my misleading suggestion here before.