This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/83217] New: Compiler segfault: structured binding by reference to a templated type via a pointer


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]