Commit 160387c4 by Jason Merrill

new

From-SVN: r21300
parent 6288717f
// test for implicit declaration
// Special g++ Options: -w
int
main ()
{
return blarg ();
}
extern "C" int
blarg (...)
{
return 0;
}
// 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;
......
//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;
}
// 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];
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment