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

            Bug ID: 125901
           Summary: Lifting not-yet-instantiated template class gives
                    incorrect result for is_trivially_copyable_type
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: michael.email.acc at gmail dot com
  Target Milestone: ---

Created attachment 64796
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64796&action=edit
.ii file

Full GCC version: g++
(Compiler-Explorer-Build-gcc-3ddf16f3e94b36346a36dca17e17fdd5388da911-binutils-2.44)
17.0.0 20260619 (experimental) (Full details can be seen by appending -v to
arguments in Godbolt link)

Reproduction (Godbolt link): https://godbolt.org/z/84WhYMM8r

Code (compiles, incorrectly, with g++ -std=c++26 -freflection):

```
#include <meta>
#include <vector>

static_assert(is_trivially_copyable_type(^^std::vector<int>)); // incorrect
const std::vector<int> vec{};
static_assert(!is_trivially_copyable_type(^^std::vector<int>)); // correct

int main() {}
```

I suspect the root cause for this may be previously reported but I was unable
to find anything.

I do not have GCC 17 available locally but this is also reproduced on GCC 16.1:
g++-16 -std=c++26 -freflection -v -save-temps bug.cpp for the .ii file
attached.
  • [Bug c++/125901] New: Lift... michael.email.acc at gmail dot com via Gcc-bugs

Reply via email to