Assertion `MaybeODRUseExprs.empty() && "Leftover expressions for odr-use checking"' failed (recent regression)
| Bugzilla Link | 42829 |
| Resolution | DUPLICATE |
| Resolved on | Aug 28, 2019 13:34 |
| Version | trunk |
| OS | Linux |
| Blocks | llvm/llvm-project#41819 |
| CC | @davidbolvansky,@DougGregor,@zmodem,@zygoloid |
Extended Description
Starting with:
commit 715f7a1bd058c64a39cc4773114dfb46ae8cc8a3 Author: Richard Smith [email protected] Date: Tue Jun 11 17:50:32 2019 +0000
For DR712: store on a DeclRefExpr whether it constitutes an odr-use.
Begin restructuring to support the forms of non-odr-use reference
permitted by DR712.
llvm-svn: 363086
The following code causes an assertion failure:
$ cat test.cc const unsigned long s = alignof(int); void foo() { alignas(s) int j; }
$ clang -fsyntax-only test.cc ... clang/lib/Sema/SemaDecl.cpp:13525: clang::Decl* clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool): Assertion `MaybeODRUseExprs.empty() && "Leftover expressions for odr-use checking"' failed. ...
mentioned in issue llvm/llvm-bugzilla-archive#43080
Yes, it's likely benign (this might in some rare cases cause us to fail to emit a needed variable or to reject valid code, but if we create a program that links, the program should be correct).
If the bug is merely an assertion failure in debug builds and can't actually cause incorrect code to be generated, we are fine with it.
It sounds likely to be benign, but maybe Richard can confirm?
If the bug is merely an assertion failure in debug builds and can't actually cause incorrect code to be generated, we are fine with it.
Looking at the dupe, fixing this sounds tricky, and it doesn't sound like something that can be fixed before the release.
Mikhail, how bad is this bug for you, is it something you can work around?
*** This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#43080 ***
Might be a related to llvm/llvm-project#41812