https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125939

            Bug ID: 125939
           Summary: [reflection] std::meta::is_copy_constructible_type
                    result in error for int& in template
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chzn at mail dot ustc.edu.cn
  Target Milestone: ---

https://godbolt.org/z/66rYfrbGE

```
#include <meta>

template<typename T>
constexpr bool cct = std::meta::is_copy_constructible_type(^^T);

int main() {
    using T = int&;
    static_assert(std::meta::is_copy_constructible_type(^^T)); // OK
    static_assert(cct<int&>);   // Error
    return 0;
}
```

result in

```
<source>: In instantiation of 'constexpr const bool cct<int&>':
<source>:9:19:   required from here
    9 |     static_assert(cct<int&>);   // Error
      |                   ^~~~~~~~~
<source>:4:59: error: 'const' qualifiers cannot be applied to 'int&'
    4 | constexpr bool cct = std::meta::is_copy_constructible_type(^^T);
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
```

Reply via email to