view gcc/testsuite/g++.dg/template/pr88795.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

// { dg-do compile { target c++17 } }

template<class, int>
struct Array {};

template<class T, int size_>
struct Foo {
  static constexpr int size() {
      return size_;
  }

  template<class U>
  Foo(U, Array<T, size()>) {}
};

template<class T, int size, class U>
Foo(U, Array<T, size>) -> Foo<T, size>;

int main() {
  Array<int, 2> arr{};

  Foo foo{2.0, arr};
}