This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/708: useless warning for legal code
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/708: useless warning for legal code
- From: sebor at roguewave dot com
- Date: 29 Oct 2000 23:28:41 -0000
- Reply-To: sebor at roguewave dot com
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, sebor@roguewave.com
>Number: 708
>Category: c++
>Synopsis: useless warning for legal code
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Sun Oct 29 15:36:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: sebor@roguewave.com
>Release: 2.95.2
>Organization:
>Environment:
>Description:
The code below generates a warning, presumably alerting the
programmer to the relatively recently implemented dependent
name lookup rules. IMO, warnings should not be issued for
legal code unless explicitly requested as they often force
people to work around them in cumbersome ways, making
writing portable code unnecessarily difficult.
t.cpp:13: warning: lookup of `V' finds `typedef typename T::V B<T>::V'
t.cpp:13: warning: instead of `typename B<T>::C::V' from dependent base class
t.cpp:13: warning: (use `typename C::V' if that's what you meant)
>How-To-Repeat:
$ cat << EOF > t.cpp && g++ -c t.cpp
template <class T>
struct A
{
typedef T V;
};
template <class T>
struct B
{
typedef typename T::V V;
struct C: A<V> {
typedef A<V> X;
};
};
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: