Issue 55376
Summary Checking whether clang++ supports C++17 features failed
Labels new issue
Assignees
Reporter huxiaoheng44
    Here is a case generated when I compiled an application called moose with LLVM at the stage of configure, more specifically, Checking whether clang++ supports C++17 features. I extracted the codes raised the error.
```
//test.cpp
#include <initializer_list>
#include <utility>
#include <type_traits>

namespace test_structured_bindings
  {

    int arr[2] = { 1, 2 };
    std::pair<int, int> pr = { 1, 2 };

    auto f1() -> int(&)[2]
    {
      return arr;
    }

    auto f2() -> std::pair<int, int>&
    {
      return pr;
    }

    struct S
    {
      int x1 : 2;
      volatile double y1;
    };

    S f3()
    {
      return {};
    }

    auto [ x1, y1 ] = f1();
    auto& [ xr1, yr1 ] = f1();
    auto [ x2, y2 ] = f2();
    auto& [ xr2, yr2 ] = f2();
    const auto [ x3, y3 ] = f3();

  }

```
###  step to reproduce the error
**For debug version**

> clang++ -c -std=gnu++17 -g test.cpp

**For Release Version**

> clang++ -S -std=gnu++17 -g -emit-llvm -o test.ll

> opt -verify test.ll

```
test.ll:1268:175: error: missing required field 'name'
!140 = distinct !DIGlobalVariable(linkageName: "_ZN5cxx1724test_structured_bindingsDC2x12y1EE", scope: !81, file: !4, line: 742, type: !82, isLocal: false, isDefinition: true)
```

**Note** : the LLVM release version enables option  `-disable-llvm-verifier`, thus bypassing the verification of IR. However, the problem still exists.




_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to