llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Assertion `MaybeODRUseExprs.empty() && "Leftover expressions for odr-use checking"' failed (recent regression)

Open miyuki opened this issue 7 years ago • 7 comments

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. ...

miyuki avatar Jul 30 '19 16:07 miyuki

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?

zmodem avatar Aug 28 '19 09:08 zmodem

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.

miyuki avatar Aug 27 '19 13:08 miyuki

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?

zmodem avatar Aug 27 '19 10:08 zmodem

*** This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#43080 ***

Might be a related to llvm/llvm-project#41812

miyuki avatar Jul 30 '19 16:07 miyuki