Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/template/friend.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// Contribued by Gabriel Dos Reis <gdr@codesourcery.com> // Origin: iskey@i100.ryd.student.liu.se class ostream; extern ostream& cout; template <class T> struct s; template <class T> ostream& operator<<(ostream &o, const typename s<T>::t &x) // { dg-message "note" } { return o; } template <class T> struct s { struct t { friend ostream& operator<<<T>(ostream&, const typename s<T>::t &); }; t x; }; int main() { s<int>::t y; cout << y; // { dg-error "" } // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } .-1 } }