RISC-V: Disable Zba optimization pattern if XTheadMemIdx is enabled
[official-gcc.git] / gcc / testsuite / g++.dg / template / spec26.C
blob253d421115373bb5dcc2781a4c36fff72a0f55f6
1 // { dg-do compile { target c++11 } }
2 // Copyright (C) 2005 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 16 Sep 2005 <nathan@codesourcery.com>
5 // PR 23519  template specialization ordering (DR214)
6 // Origin:  Maxim Yegorushkin <maxim.yegorushkin@gmail.com>
8 // DR532 clarified that the * expression is ambiguous.
10 struct A
12   template<class T> int operator+(T&) = delete;
15 template<class T> struct B
17   int operator-(A&) {return 2;}
18   template<typename R> int operator*(R&) {return 3;}
21 template <typename T, typename R> int operator-(B<T>, R&) = delete;
22 template<class T> int operator+(A&, B<T>&) { return 5;}
23 template <typename T> int operator*(T &, A&){return 6;}
25 int main()
27   A a;
28   B<A> b;
29   if ((a + b) != 5)
30     return 1;
31   
32   if ((b - a) != 2)
33     return 2;
34   
35   if ((b * a) != 6)             // { dg-error "ambiguous" }
36     return 3;