Skip to content

[coverage] crash with ExprWithCleanups in if constexpr #80285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hanickadot opened this issue Feb 1, 2024 · 4 comments · Fixed by #80292
Closed

[coverage] crash with ExprWithCleanups in if constexpr #80285

hanickadot opened this issue Feb 1, 2024 · 4 comments · Fixed by #80292
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. coverage crash Prefer [crash-on-valid] or [crash-on-invalid] release:backport

Comments

@hanickadot
Copy link
Contributor

Clang main and 18 crashes with this code: (-fprofile-instr-generate -fcoverage-mapping -std=c++17)

struct false_value {
	constexpr operator bool() {
		return false;
	}
};

void foo()
{
	if constexpr (false_value{}) { };
}

https://godbolt.org/z/833ej19rP

It's a bug in my recent change #78033 ... writing patch now, this is so it's visible.

@hanickadot hanickadot changed the title [coverage] crash with CXXUnresolvedConstructExpr in if constexpr [coverage] crash with ExprWithCleanups in if constexpr Feb 1, 2024
@EugeneZelenko EugeneZelenko added clang:codegen IR generation bugs: mangling, exceptions, etc. crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Feb 1, 2024
@llvmbot
Copy link
Member

llvmbot commented Feb 1, 2024

@llvm/issue-subscribers-clang-codegen

Author: Hana Dusíková (hanickadot)

Clang `main` and `18` crashes with this code: (`-fprofile-instr-generate -fcoverage-mapping -std=c++17`)
struct false_value {
	constexpr operator bool() {
		return false;
	}
};

void foo()
{
	if constexpr (false_value{}) { };
}

https://godbolt.org/z/833ej19rP

It's a bug in my recent change #78033 ... writing patch now, this is so it's visible.

@hanickadot
Copy link
Contributor Author

/cherry-pick bfc6eaa

llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Feb 1, 2024
@llvmbot
Copy link
Member

llvmbot commented Feb 1, 2024

/pull-request #80356

@EugeneZelenko EugeneZelenko reopened this Feb 1, 2024
@tstellar tstellar moved this from Needs Triage to Done in LLVM Release Status Feb 2, 2024
@mjklemm mjklemm closed this as completed Feb 3, 2024
@mjklemm mjklemm reopened this Feb 3, 2024
@mjklemm
Copy link
Contributor

mjklemm commented Feb 5, 2024

Hey folks, this was completely unintentional that GitHub closed this issue. I maintain a private fork for stuff that I do not feel ready for prime time yet and I had pushed to that fork. How can I prevent this stuff from happening in the future? Does anyone know? And, apologies again!

agozillon pushed a commit to agozillon/llvm-project that referenced this issue Feb 5, 2024
tstellar pushed a commit to tstellar/llvm-project that referenced this issue Feb 14, 2024
tstellar pushed a commit to tstellar/llvm-project that referenced this issue Feb 14, 2024
tstellar pushed a commit to tstellar/llvm-project that referenced this issue Feb 14, 2024
tstellar pushed a commit to tstellar/llvm-project that referenced this issue Feb 14, 2024
@hexhexD hexhexD closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. coverage crash Prefer [crash-on-valid] or [crash-on-invalid] release:backport
Projects
Development

Successfully merging a pull request may close this issue.

4 participants