// { dg-do compile { target c++11 } } // Copyright (C) 2005 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 16 Sep 2005 // PR 23519 template specialization ordering (DR214) // Origin: Maxim Yegorushkin // DR532 clarified that the * expression is ambiguous. struct A { template int operator+(T&) = delete; }; template struct B { int operator-(A&) {return 2;} template int operator*(R&) {return 3;} }; template int operator-(B, R&) = delete; template int operator+(A&, B&) { return 5;} template int operator*(T &, A&){return 6;} int main() { A a; B b; if ((a + b) != 5) return 1; if ((b - a) != 2) return 2; if ((b * a) != 6) // { dg-error "ambiguous" } return 3; }