view gcc/testsuite/g++.dg/cpp1y/var-templ5.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

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

template<int A, int B>
  struct S1
  {
    static constexpr int a = A;
    static constexpr int b = B;
  };

template<class T>
  constexpr int var = T::a + T::b;

template<template<int,int> class T, int A>
  constexpr int var2 = var<T<A, A>> + A;

int main ()
{
  static_assert(var2<S1, 40> == 120, "");
}