This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/83217] New: Compiler segfault: structured binding by reference to a templated type via a pointer
- From: "emadwilliam92 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 Nov 2017 17:13:53 +0000
- Subject: [Bug c++/83217] New: Compiler segfault: structured binding by reference to a templated type via a pointer
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83217
Bug ID: 83217
Summary: Compiler segfault: structured binding by reference to
a templated type via a pointer
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: emadwilliam92 at gmail dot com
Target Milestone: ---
The following code produces a compiler segmentation fault.
```
template <typename T>
struct Object
{
T a;
};
int main()
{
Object<int> *it;
auto & [k] = *it;
}
```
I'm getting the same error with g++ 7.1 and 7.2, with --std=c++1z on x86.
Here's the compiler error:
```
<source>: In function 'int main()':
10 : <source>:10:19: internal compiler error: Segmentation fault
auto & [k] = *it;
^~
mmap: Cannot allocate memory
```