Commit a0f95f3f by Martin v. Loewis Committed by Robert Lipe

From Martin Von Loewis.
       * g++.ns/{alias2.C, alias5.C, koenig4.C, lookup3.C ns13.C,
       ns14.C, ns15.C, template3.C, undef1.C, using4.C, using5.C,
       using6.C, using7.C}:  New namespace tests.

From-SVN: r21043
parent b458ba78
void f();
void f(int);
namespace A{
struct S{
void f();
void f(S);
};
void f(S&){}
void h(S&){}
}
template<class T>
void g(T t){
f(t);
}
int main()
{
A::S s;
f(s);
g(s);
h(s);
}
namespace A{
int i;
int f();
}
int A::f()
{
return i;
}
main()
{
return A::f();
}
namespace std{
void f(){}
void g();
int i=5;
}
void std::g()
{}
main()
{
return std::i-5;
}
//Special g++ Options: -fhonor-std
namespace std{
int f(){
return 0;
}
}
int f()
{
return 1;
}
int main()
{
return std::f();
}
//Build don't link:
namespace std {}
//Check instantiation of templates outside their namespace
namespace A{
template <class T>void g(){}
template <class T> struct B {
B(){
f();
}
void f()
{
g<T>();
}
};
}
template class A::B<int>;
A::B<int> s;
int main()
{
return 0;
}
//Build don't link:
namespace A{
}
struct Y: A::S<int>{}; //ERROR - no such type
//Build don't link
#include <vector>
namespace csp {
using namespace std::vector; // ERROR - vector is not a namespace
}
// Build don't link:
namespace a {
class b {
using std::c; //ERROR - namespace using on class level
};
}
//Build don't link:
#include <vector>
namespace csp {
using namespace std;
struct X {
vector<int> v;
};
}
namespace X{
void f(int){}
}
void f();
int main()
{
using X::f;
f(3);
}
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