OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/gnu-old/gcc-4.2.2/gcc/testsuite/g++.dg/tc1
    from Rev 154 to Rev 816
    Reverse comparison

Rev 154 → Rev 816

/dr135.C
0,0 → 1,8
// { dg-do compile }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// DR135: Class type in in-class member function definitions
 
struct S {
S f() { return S(); } // { dg-bogus "" "incomplete class type is allowed as return type" }
void g(S) { } // { dg-bogus "" "incomplete class type is allowed as parameter type" }
};
dr135.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr217.C =================================================================== --- dr217.C (nonexistent) +++ dr217.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR217: Default arguments for non-template member functions of class +// templates + +template +struct S +{ + void foo (int); +}; + +template +void S::foo (int = 0) // { dg-error "" "default arguments for parameters of member functions of class templates can be specified in the initial declaration only" { xfail *-*-* } } +{ }
dr217.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr137.C =================================================================== --- dr137.C (nonexistent) +++ dr137.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR137: static_cast of cv void* + +struct A; + +const void* v; + +void foo(void) +{ + (void)static_cast(v); + (void)static_cast(v); // { dg-error "" "static_cast cannot remove cv qualifiers" } +}
dr137.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr193.C =================================================================== --- dr193.C (nonexistent) +++ dr193.C (revision 816) @@ -0,0 +1,72 @@ +// { dg-do run } +// Origin: Giovanni Bajo +// DR193: Order of destruction of local automatics of destructor + +extern "C" void abort(void); + +namespace N1 { + bool a_done = false; + struct A + { + ~A() + { + a_done = true; + } + }; + + struct B + { + ~B() + { + if (!a_done) + abort(); + } + }; + + struct C { + B x; + ~C() { + A y; + }; + }; +} + + +namespace N2 { + bool a_done = false; + + template + struct A + { + ~A() + { + a_done = true; + } + }; + + template + struct B + { + ~B() + { + if (!a_done) + abort(); + } + }; + + template + struct C { + B x; + ~C() { + A y; + }; + }; +} + + +int main(void) +{ + N1::C c1; + N2::C c2; + return 0; +}
dr193.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr194.C =================================================================== --- dr194.C (nonexistent) +++ dr194.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR194: Identifying constructors + +struct A +{ + inline explicit A(); +}; + +template +struct B +{ + inline explicit B(); +}; + +template struct B;
dr194.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr176.C =================================================================== --- dr176.C (nonexistent) +++ dr176.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR176: Name injection and templates + +namespace N1 { + template struct Base { + Base* p; + Base* p2; + ::Base* p3; // { dg-error "" "" } + }; + + template struct Derived: public Base { + Base* p; // { dg-bogus "" "injected class name in derived classes" { xfail *-*-* } } + Base* p2; + typename Derived::Base* p3; // { dg-bogus "" "injected class name in derived classes" { xfail *-*-* } } + }; + + template struct Derived; // { dg-bogus "instantiated from here" "everything should be looked up at parsing time (after DR224)" { xfail *-*-* } } +} + + +namespace N2 { + template struct Base {}; + template struct Derived: public Base { + typename Derived::template Base* p1; // { dg-bogus "" "" { xfail *-*-* } } + }; + + template struct Derived; +}
dr176.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr159.C =================================================================== --- dr159.C (nonexistent) +++ dr159.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR159: Namespace qualification in declarators + +namespace N { + namespace M { + void f(); + void g(); + } + void M::f(){} + void N::M::g(){} +}
dr159.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr179.C =================================================================== --- dr179.C (nonexistent) +++ dr179.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR179: Function pointers and subtraction + +void foo(void); +typedef void (*fp)(void); + +int main() +{ + fp f1 = foo; + fp f2 = foo; + (void)f2-f1; // { dg-error "" "cannot subtract pointers to function" } +}
dr179.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr52.C =================================================================== --- dr52.C (nonexistent) +++ dr52.C (revision 816) @@ -0,0 +1,34 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR52: Non-static members, member selection and access checking + +struct A +{ + void foo(void); +}; + +struct B +{ +private: + void foo(void); +}; + +struct B1 : B {}; +struct B2 : B {}; + +struct C +{ // { dg-error "C" } + void foo(void); +}; + +struct D : private C {}; + +struct X: A, B1, B2, D +{ +public: + void bar(void) + { + this->B::foo(); // { dg-error "" } + this->C::foo(); // { dg-error "inaccessible|context" } + } +};
dr52.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr90.C =================================================================== --- dr90.C (nonexistent) +++ dr90.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR90: Should the enclosing class be an "associated class" too? + +struct A { + union U {}; + friend void f(U); +}; + +struct B { + struct S {}; + friend void f(S); +}; + +int main() { + A::U u; + f(u); + B::S s; + f(s); +}
dr90.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr74.C =================================================================== --- dr74.C (nonexistent) +++ dr74.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR74: Enumeration value in direct-new-declarator + +struct A {}; +enum E1 { COUNT = 10 }; + +A* a = new A[COUNT]; +
dr74.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr76.C =================================================================== --- dr76.C (nonexistent) +++ dr76.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR76: Are const volatile variables considered "constant expressions"? + +volatile const int a = 5; + +template struct K; +template struct K; // { dg-error "" }
dr76.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr94.C =================================================================== --- dr94.C (nonexistent) +++ dr94.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR94: Inconsistencies in the descriptions of constant expressions + +struct S { + static const int c = 5; +}; +int a[S::c]; +
dr94.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr101.C =================================================================== --- dr101.C (nonexistent) +++ dr101.C (revision 816) @@ -0,0 +1,31 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR101: Redeclaration of extern "C" names via using-declarations + +namespace Test1 { + + typedef unsigned int X; + extern "C" void f1(); + namespace N { + typedef unsigned int X; + extern "C" void f1(); + } + using N::f1; // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" } + using N::X; // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" } +} + + +namespace Test2 { + + typedef unsigned int X; // { dg-bogus "X" "" { xfail *-*-* } } + extern "C" int f2(); + namespace N { + typedef unsigned int X; // { dg-bogus "X" "" { xfail *-*-* } } + extern "C" int f2(); + } + using namespace N; + int i = f2(); // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" } + X x; // { dg-bogus "" "redeclaration through 'using' should not be ambiguous" { xfail *-*-* } } + +} +
dr101.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr142.C =================================================================== --- dr142.C (nonexistent) +++ dr142.C (revision 816) @@ -0,0 +1,32 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR142: Injection-related errors in access example + +class B { // { dg-error "inaccessible" } +public: + int mi; // { dg-error "inaccessible" } + static int si; // { dg-error "inaccessible" } +}; + +class D: private B { +}; + +class DD: public D { + void f(); +}; + +void DD::f() { + mi = 3; // { dg-error "within this context" "" } + si = 3; // { dg-error "within this context" "" } + ::B b; + b.mi = 3; + b.si = 3; + ::B::si = 3; + ::B* bp1 = this; // { dg-error "inaccessible base" "" } + ::B* bp2 = (::B*)this; + bp2->mi = 3; + + + B b2; // { dg-error "within this context" "" } + B::si = 3; // { dg-error "within this context" "" } +}
dr142.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr161.C =================================================================== --- dr161.C (nonexistent) +++ dr161.C (revision 816) @@ -0,0 +1,50 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR161: Access to protected nested type + +namespace N1 { + struct A + { + protected: + typedef int type; + }; + + struct B : public A + { + void test(void) + { + A::type t; + } + + friend void ftest(void) + { + A::type t; + } + }; +} + + +namespace N2 { + template + struct A + { + protected: + typedef int type; + }; + + template + struct B : public A + { + void test(B b) + { + typename A::type t; + } + + friend void ftest(B b) + { + typename A::type t; + } + }; + + template struct B; +}
dr161.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr108.C =================================================================== --- dr108.C (nonexistent) +++ dr108.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR108: Are classes nested in templates dependent? + +template struct S { + struct I1 { + typedef int X; + }; + struct I2 : public I1 { + X x; // { dg-error "does not name a type" } + }; +}; + +// Additional notes on the same line are allowed +// { dg-error "" "additional" { target *-*-* } 10 }
dr108.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr127.C =================================================================== --- dr127.C (nonexistent) +++ dr127.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do link } +// Origin: Giovanni Bajo +// DR127: Ambiguity in description of matching deallocation function + +#include +#include + +struct A +{ + // placement new, but can be called through normal new syntax. + void* operator new(std::size_t size, float = 0.0f) + { + return ::operator new(size); + } + + // The matching deallocation function must be called, which means + // the placemente delete. + void operator delete(void*); + void operator delete(void*, float) {} + + A() + { throw 5; } +}; + +int main() +{ + (void)new A; +}
dr127.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr164.C =================================================================== --- dr164.C (nonexistent) +++ dr164.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do link } +// Origin: Giovanni Bajo +// DR164: Overlap between Koenig and normal lookup + +void f(int); + +template void g(T t) { + f(t); +} + +enum E { e }; + +void f(E) {} + +int main() { + g(e); +}
dr164.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr128.C =================================================================== --- dr128.C (nonexistent) +++ dr128.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do run } +// Origin: Giovanni Bajo +// DR128: Casting between enum types + +extern "C" void abort(void); + +enum E1 { BLACK = 0, RED = 1 }; +enum E2 { WHITE = 0, YELLOW = 1}; + +int main(void) +{ + E1 e1 = RED; + E2 e2 = static_cast(e1); + if (e2 != YELLOW) + abort(); + return 0; +}
dr128.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr147.C =================================================================== --- dr147.C (nonexistent) +++ dr147.C (revision 816) @@ -0,0 +1,31 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR147: Naming the constructor (PR 11764) + +namespace N1 { + +struct A { A(); }; +struct B: public A { B(); }; + +A::A() { } +B::B() { } + +B::A ba; +A::A a; // { dg-error "" "the injected-class-name can never be found through qualified lookup" { xfail *-*-* } } + +} + +namespace N2 { + +// This is nasty: if we allowed the injected-class-name to be looked as a +// qualified type, then the following code would be well-formed. Basically +// the last line is defining the static member (with redundant parenthesis). +// Instead, it should be rejected as a malformed constructor declaration. + +template struct A { + template A(T2); + static A x; +}; +template<> A::A(A::x); // { dg-error "" "this is an invalid declaration of the constructor" { xfail *-*-* } } + +}
dr147.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr166.C =================================================================== --- dr166.C (nonexistent) +++ dr166.C (revision 816) @@ -0,0 +1,60 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR166: Friend declarations of template-ids + +namespace N { + template void f(T); + void g(); + + namespace M { + class A { + friend void f(int); // N::f + static int x; // { dg-error "private" } + }; + + class B { + template friend void f(T); // M::f + static int x; // { dg-error "private" } + }; + + class C { + friend void g(); // M::g + static int x; // { dg-error "private" } + }; + + template void f(T) // will be instantiated as f + { + M::A::x = 0; // { dg-error "within this context" } + M::B::x = 0; + } + template <> void f(int) + { M::A::x = 0; } // { dg-error "within this context" } + template <> void f(double ) + { + M::B::x = 0; + M::f(0); // { dg-error "instantiated" } + } + + void g(void) + { M::C::x = 0; } + } + + template void f(T) // will be instantiated as f + { + M::A::x = 0; // { dg-error "within this context" } + M::B::x = 0; // { dg-error "within this context" } + } + + template <> void f(int ) + { + N::f(0); // { dg-error "instantiated" } + M::A::x = 0; + M::B::x = 0; // { dg-error "within this context" } + } + + template <> void f(char ) + { M::A::x = 0; } // { dg-error "within this context" } + + void g(void) + { M::C::x = 0; } // { dg-error "within this context" } +}
dr166.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr185.C =================================================================== --- dr185.C (nonexistent) +++ dr185.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do run } +// Origin: Giovanni Bajo +// DR185: "Named" temporaries and copy elision + +extern "C" void abort(void); + +struct A { + mutable int value; + explicit A(int i) : value(i) {} + void mutate(int i) const { value = i; } +}; + +int foo() { + A const& t = A(1); + A n(t); // can this copy be elided? NO! + t.mutate(2); + return n.value; // can this return 2? NO! +} + +int main() +{ + int x = foo(); + if (x != 1) + abort(); + return 0; +}
dr185.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr188.C =================================================================== --- dr188.C (nonexistent) +++ dr188.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR188: Comma operator and rvalue conversion + +template struct StaticAssert; +template <> struct StaticAssert {}; + +char arr[100]; +StaticAssert<(sizeof(0,arr) == 100)> check;
dr188.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr20.C =================================================================== --- dr20.C (nonexistent) +++ dr20.C (revision 816) @@ -0,0 +1,34 @@ +// { dg-do run } +// Origin: Giovanni Bajo +// DR20: Some clarifications needed for 12.8 para 15 + +extern "C" void printf(const char*, ...); +extern "C" void abort(void); + +int count = 0; + +class Thing { +public: + Thing() { + } + ~Thing() { + } + Thing(const Thing&) + { + count += 1; + } +}; + +Thing f() { + Thing t; + return t; +} + +int main(void) +{ + Thing t2 = f(); + printf("%d %x\n", count, &t2); + if (count != 0) + abort(); + return 0; +}
dr20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr80.C =================================================================== --- dr80.C (nonexistent) +++ dr80.C (revision 816) @@ -0,0 +1,53 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR80: Class members with same name as class + +struct A +{ + int A; +}; + +struct A2 +{ + static int A2; // { dg-error "same name as" } +}; + + +template +struct A3 +{ + int A3; +}; + +template +struct A4 +{ + static int A4; // { dg-error "same name as" } +}; + + +struct B +{ + B(); + int B; // { dg-error "same name as" } +}; + +struct B2 +{ + B2(); + static int B2; // { dg-error "same name as" } +}; + +template +struct B3 +{ + B3(); + int B3; // { dg-error "same name as" "this error should appear at parsing time" { xfail *-*-* } } +}; + +template +struct B4 +{ + B4(); + static int B4; // { dg-error "same name as" } +};
dr80.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr48.C =================================================================== --- dr48.C (nonexistent) +++ dr48.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do link } +// Origin: Giovanni Bajo +// DR48: Definitions of unused static members + +struct A { + static const int size = 10; + int array[size]; +}; + +int main() { + A a; + return 0; +}
dr48.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr49.C =================================================================== --- dr49.C (nonexistent) +++ dr49.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do compile } +// Contributed by: Giovanni Bajo +// DR 49: Non-constant pointers are invalid template arguments. + +template struct R { /* ... */ }; +template struct S { /* ... */ }; + +int p; +template struct R<&p>; // OK +template struct S<&p>; // OK due to parameter adjustment + +int *ptr; +template struct R; // { dg-error "argument" } +template struct S; // { dg-error "argument" } + +int v[5]; +template struct R; // OK due to implicit argument conversion +template struct S; // OK due to both adjustment and conversion +
dr49.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr85.C =================================================================== --- dr85.C (nonexistent) +++ dr85.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR85: Redeclaration of member class + +struct Base { + struct Data {}; + struct Data; // { dg-error "" "redeclaration of nested class is invalid" { xfail *-*-* } } +};
dr85.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr68.C =================================================================== --- dr68.C (nonexistent) +++ dr68.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR68: Grammar does not allow "friend class A;" + +namespace A{ + class B{}; +} + +namespace B{ + class A{}; + class C{ + friend class ::A::B; + }; +} + + +template class K; +class J { + friend class K; +};
dr68.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr1.C =================================================================== --- dr1.C (nonexistent) +++ dr1.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR1: What if two using-declarations refer to the same function but the +// declarations introduce different default-arguments? + +namespace A { + extern "C" void f(int = 5); +} +namespace B { + extern "C" void f(int = 5); +} +using A::f; +using B::f; + +void use() { + f(3); + f(); // { dg-error "" "" { xfail *-*-* } } +}
dr1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr213.C =================================================================== --- dr213.C (nonexistent) +++ dr213.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR213: Lookup in dependent base classes + +// We should emit an error at *instantiation* time because g(t) can't be +// resolved to any function. + +template struct A : T { + void h(T t) { + f(t); + g(t); // { dg-error "" "" { xfail *-*-* } } + } +}; + +struct B { + void f(B); + void g(B) {}; +}; + +void f(B) {} + +int main() +{ + A ab; // { dg-error "" "" { xfail *-*-* } } + B b; + ab.h(b); +}
dr213.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dr152.C =================================================================== --- dr152.C (nonexistent) +++ dr152.C (revision 816) @@ -0,0 +1,36 @@ +// { dg-do compile } +// Origin: Giovanni Bajo +// DR152: explicit copy constructors + +namespace N1 { + struct X { + X(); + explicit X(const X&); + }; + void f(X); + int foo() + { + X x; + f(x); // { dg-error "" "" } + } +} + +namespace N2 { + template + struct X { + X(); + explicit X(const X&); + }; + + template + void f(T ) {} + + template + int foo() + { + X x; + N2::f(x); // { dg-error "" "" } + } + + template int foo(); // { dg-error "instantiated from here" } +}
dr152.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.