Fixes clang crash reported in PR27778.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
How is this different from test/SemaCUDA/launch_bounds.cu:27-28? It does
const int constint = 512; __launch_bounds__(constint) void TestConstInt(void);
which looks verbatim the same as this testcase.
Existing test is a declaration of the function which did not trigger the crash.
Second issue is that -verify interferes with reproduction case -- the crash does not happen if any //expect-* are seen before it.
Plus, the outcome of the failing test is a crash which would prevent reports of other failures.
Separate test file makes the crash isolated and reliably reproducible.
Got it, thanks.
Should we have a test that passes a char or a short and ensures that we do the correct implicit conversion there?
lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
4045 ↗ | (On Diff #59611) | Should we update this name and comment? |
lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
4044 ↗ | (On Diff #59624) | Nit, Oxford comma helps some here. |
4046 ↗ | (On Diff #59624) | Presumably it "returns nullptr and outputs an error" otherwise? Like, we get nullptr iff it outputs an error? |
4079 ↗ | (On Diff #59624) | Do we need to output an error here, or is does PerformCopyInitialization do so for us? In any case, is it covered by a test? |
lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
4046 ↗ | (On Diff #59624) | It returns nullptr without error message in case of unexpanded parameter pack. |
4079 ↗ | (On Diff #59624) | Actually, by this point we've verified that Expr is an ICE. I assume that PerformCopyInitialization() should always succeed for such an expression. |
lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
4079 ↗ | (On Diff #59631) | OK, so then we want an assert, not an if? |
Replaced if() with assert() to catch unexpected PerformCopyInitialization() failures.