[Bug c++/25999] New: compiler loses extern C for function after #pragma weak
The following short program generates the mangled symbol _Z3Foov instead of the expected Foo when built with -DBUG. Without -DBUG and the #pragma weak Random_Symbol line, or if using g++ 3.2.3, the expected thing happens. extern C { void Foo(); } #ifdef BUG #pragma weak Random_Symbol #endif void Foo() { } -- Summary: compiler loses extern C for function after #pragma weak Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: metcalf at lcs dot mit dot edu GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25999
[Bug c++/25783] New: member variable lookup fails in subclass of templated base class
The appended snippet of code should be able to resolve the member variable foo in both the Foo1 and Foo2 member functions, but it can't (error: foo was not declared in this scope). The this- prefix appears to be required to workaround this problem. The code compiles fine with gcc 3.2.3. template class X class Base { public: int foo; }; template class X class Subclass : public BaseX { public: int Foo1() { return this-foo; } int Foo2() { return foo; } }; -- Summary: member variable lookup fails in subclass of templated base class Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: metcalf at lcs dot mit dot edu GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25783
[Bug c++/25784] New: friend class forward declaration doesn't actually declare class
In the appended snippet of code, the Foo2 class is only forward-declared in the context of a friend statement (friend class Foo2). With gcc 3.2.3 this sufficed to forward-declare it. With gcc 4.0.2 you must have a forward declaration without a friend qualifier or gcc won't recognize the class type name when it encounters it later. Compiling this snippet yields ISO C++ forbids declaration of Foo2 with no type. class Bar { class Foo1; friend class Foo1; friend class Foo2; Foo1* foo1; Foo2* foo2; }; -- Summary: friend class forward declaration doesn't actually declare class Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: metcalf at lcs dot mit dot edu GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25784