--- /dev/null
+// test for implicit declaration
+// Special g++ Options: -w
+
+int
+main ()
+{
+ return blarg ();
+}
+
+extern "C" int
+blarg (...)
+{
+ return 0;
+}
--- /dev/null
+// 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?
+}
namespace B{
using namespace A;
- void f(int);
+ void f(int); // ERROR - referenced below
}
using namespace B;
--- /dev/null
+//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;
+}
+
--- /dev/null
+// 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];
+};