[all-commits] [llvm/llvm-project] 17508c: [NFC] Fix builds on recent GCC with C++20 enabled

Alexander Batashev via All-commits all-commits at lists.llvm.org
Tue Jul 18 09:45:06 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 17508cbcc628ad45012660362bd1ace81da85f3b
      https://github.com/llvm/llvm-project/commit/17508cbcc628ad45012660362bd1ace81da85f3b
  Author: Alexander Batashev <alexbatashev at gmail.com>
  Date:   2023-07-18 (Tue, 18 Jul 2023)

  Changed paths:
    M llvm/include/llvm/CodeGen/ByteProvider.h
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp

  Log Message:
  -----------
  [NFC] Fix builds on recent GCC with C++20 enabled

The following pattern fails on recent GCC versions with -std=c++20 flag passed
and succeeds with -std=c++17. Such behavior is not observed on Clang 16.0.

```c++
template <typename T>
struct Foo {
    Foo<T>(int a) {}
};
```

This patch removes template parameter from constructor in two occurences to
make the following command complete successfully:
bazel build -c fastbuild --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 @llvm-project//llvm/...

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D154782




More information about the All-commits mailing list