// expected-error@+1 {{externally available entity 'n1' is not previously declared in an included file (if it is only used in this translation unit, make it static or put it in an unnamed namespace; otherwise, provide a declaration of it in an included file) [loplugin:external]}}
friendvoidf1(){}// no warning for injected function (no place where to mark it `static`)
template<typename>friendvoidft1(){}// ...nor for injected function template
// expected-error@+1 {{externally available entity 'f2' is not previously declared in an included file (if it is only used in this translation unit, make it static; otherwise, provide a declaration of it in an included file) [loplugin:external]}}
friendvoidf2(){}
};
structS2
{
friendvoidf1();
template<typename>friendvoidft1();
// expected-note@+1 {{another declaration is here [loplugin:external]}}
friendvoidf2();
};
staticvoidg()
{
voidf1();
// expected-note@+1 {{another declaration is here [loplugin:external]}}
voidf2();
}
// expected-note@+1 {{another declaration is here [loplugin:external]}}
// expected-note@+1 {{another declaration is here [loplugin:external]}}
enumE:int;
// expected-error@+1 {{externally available entity 'E' is not previously declared in an included file (if it is only used in this translation unit, put it in an unnamed namespace; otherwise, provide a declaration of it in an included file) [loplugin:external]}}
enumE:int
{
};
}
}
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
staticvoidg(std::vector<E>)
{
// expected-note@+1 {{another declaration is here [loplugin:external]}}
voidf(Econst*);
}
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
voidf(Econst*);
extern"C++"{
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
voidfc(Econst*);
}
structS1
{
structS2;
// No note about associating function; injected friend function not found by ADL:
friendvoidf2(Econst*);
};
inlinenamespaceI2
{
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
voidf3(E);
inlinenamespaceI3
{
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
voidf4(E);
}
}
}
structN::S1::S2
{
// expected-note@+1 {{another declaration is here [loplugin:external]}}