[Bug c++/11938] New: Possible name lookup regression in 3.4

raimond_merkert at raytheon dot com gcc-bugzilla@gcc.gnu.org
Sat Aug 16 01:18:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11938

           Summary: Possible name lookup regression in 3.4
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raimond_merkert at raytheon dot com
                CC: gcc-bugs at gcc dot gnu dot org

I get a strange error message when compiling this code with 3.4.

test.cpp: In destructor `Derived<T>::~Derived()':
test.cpp:12: error: there are no arguments to `shutdown' that depend on a
   template parameter, so a declaration of `shutdown' must be available
test.cpp:12: error: (if you use `-fpermissive', G++ will accept your code, but
   allowing the use of an undeclared name is deprecated)

cat > test.cpp <<EOF

template <class T>
struct  Base {
 Base () {}
  virtual ~Base() {}
  inline void shutdown (bool x) {}
};

template <class T>
struct Derived : public Base<T> {
  Derived () {}
  ~Derived ()
  { shutdown(true); }
};
EOF
gcc -c test.cpp

The code compiles fine with 3.3.1, but because of the specific nature of the
error message, I don't know if this is a regression, or the code is actually
incorrect. If this is not an error, then I bet 3.4 breaks a lot of template
code. The code obviously works if I don't use templates.

The build is that from gcc-3.4-20030813.



More information about the Gcc-bugs mailing list