parent
6288717fb3
commit
160387c4a7
|
@ -0,0 +1,14 @@
|
|||
// test for implicit declaration
|
||||
// Special g++ Options: -w
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return blarg ();
|
||||
}
|
||||
|
||||
extern "C" int
|
||||
blarg (...)
|
||||
{
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// Test for Koenig lookup involving overloaded functions.
|
||||
|
||||
namespace N1 {
|
||||
struct A { };
|
||||
void f1(A) {}
|
||||
void f2(float) {}
|
||||
void g(void (*)(float)) {}
|
||||
}
|
||||
|
||||
using N1::f1;
|
||||
void f1(float) {}
|
||||
|
||||
using N1::f2;
|
||||
template <class T>
|
||||
void f2(N1::A, T) {}
|
||||
|
||||
void g(void (*)(int)) {}
|
||||
|
||||
int main() {
|
||||
g(&f1); // Works?
|
||||
g(f2); // Works?
|
||||
}
|
|
@ -5,7 +5,7 @@ namespace A{
|
|||
|
||||
namespace B{
|
||||
using namespace A;
|
||||
void f(int);
|
||||
void f(int); // ERROR - referenced below
|
||||
}
|
||||
|
||||
using namespace B;
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
//Check whether namespace-scoped template instantiations
|
||||
//are mangled differently.
|
||||
|
||||
namespace X{
|
||||
template<class T>
|
||||
struct Y{
|
||||
int f(T){
|
||||
return 1;
|
||||
}
|
||||
template<class X>void g(){}
|
||||
};
|
||||
}
|
||||
|
||||
template<class T>
|
||||
struct Y{
|
||||
int f(T){
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
X::Y<int> z;
|
||||
if (z.f(4) != 1)
|
||||
return 1;
|
||||
z.template g<long>();
|
||||
|
||||
Y<int> z1;
|
||||
if (z1.f(5) != 2)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// simple test for id from base class during class defn
|
||||
// Build don't link:
|
||||
|
||||
struct foo {
|
||||
enum { blah = 1 };
|
||||
};
|
||||
struct bar : public foo {
|
||||
char cache[blah];
|
||||
};
|
Loading…
Reference in New Issue