OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.dg/] [lookup/] [friend7.C] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
// { dg-do compile }
2
// PR c++/7874: Don't inject friend functions into global name space.
3
 
4
namespace N { template struct A { friend void f(A) { }; }; }
5
int main()
6
{
7
   N::A a;
8
   N::f(a);             // { dg-error "not a member" }
9
}
10
 
11
struct S { friend void g(); friend void h(S); };
12
struct T { friend void g(); friend void h(T); };
13
void i() {
14
  g();                  // { dg-error "not declared" }
15
  S s;
16
  h(s);
17
  T t;
18
  h(t);
19
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.