aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/consteval-expinst1.C
blob: 01452ddbbab3c27e8ca45569da61c47992247de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/96905
// { dg-do compile { target c++20 } }

template<typename Rep>
struct duration
{
  static consteval int
  gcd(int m, int n) noexcept
  {
    while (m != 0 && n != 0)
    {
      int rem = m % n;
      m = n;
      n = rem;
    }
    return m + n;
  }
};

template class duration<int>;