Skip to content
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

Structured bindings in conditions crash when using member get #36095

Closed
llvmbot opened this issue Mar 15, 2018 · 0 comments
Closed

Structured bindings in conditions crash when using member get #36095

llvmbot opened this issue Mar 15, 2018 · 0 comments
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 15, 2018

Bugzilla Link 36747
Resolution FIXED
Resolved on Mar 24, 2018 01:03
Version 6.0
OS All
Attachments Crash log
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@lichray
Fixed by commit(s) r327780

Extended Description

Here's a minimal example that I came up with

// clang++ -std=c++17 -Wbinding-in-condition -o main main.cpp

#include

struct X {
template
int get() { return 0; }

operator bool() { return true; }
};

namespace std {
template<>
struct tuple_size { static constexpr std::size_t value = 1; };
template<>
struct tuple_element<0, X> { using type = int; };
}

int main() {
if (auto[a] = X())
return a;
}

The above crashes with the attached log.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

1 participant