This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/7731: erroneous implicit typename is deprecated
- From: pauljlucas at mac dot com
- To: gcc-gnats at gcc dot gnu dot org
- Cc: pauljlucas at mac dot com
- Date: Mon, 26 Aug 2002 21:08:44 -0700
- Subject: c++/7731: erroneous implicit typename is deprecated
>Number: 7731
>Category: c++
>Synopsis: g++ issues erroneous warning: implicit typename is deprecated
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Aug 26 21:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Paul J. Lucas
>Release: 3.2
>Organization:
>Environment:
System: Linux powerbook 2.4.18-rc4-benh #1 Mon Feb 25 23:23:12 PST 2002 ppc unknown
Architecture: ppc
host: powerpc-unknown-linux-gnu
build: powerpc-unknown-linux-gnu
target: powerpc-unknown-linux-gnu
configured with: /tmp/gcc-3.2/configure --prefix=/usr/local/packages/gcc-3.2 --enable-threads=posix --enable-languages=c,c++ --disable-nls
>Description:
Compiler issues aforementioned warning regarding result_type and argument_type.
The complete warning is:
----- CUT -----
bug.c:8: warning: `typename pattern_map<T>::pattern_match::result_type' is implicitly a typename
bug.c:8: warning: implicit typename is deprecated, please see the documentation for details
bug.c:8: warning: `typename pattern_map<T>::pattern_match::argument_type' is implicitly a typename
bug.c:8: warning: implicit typename is deprecated, please see the documentation for details
----- CUT -----
Note that this warning is not issued if the class pattern_map is at file scope
and not within a template.
>How-To-Repeat:
Compile this code:
//----- CUT -----
#include <map>
template< class T > struct pattern_map : std::map< int, T > {
typedef typename std::map< int, T > map_type;
typedef typename map_type::value_type value_type;
struct pattern_match : std::unary_function< value_type const&, bool > {
result_type operator()( argument_type a ) const {
return true;
}
};
};
struct pattern_match : std::unary_function< int, bool > {
result_type operator()( argument_type a ) const {
return true;
}
};
main() {
pattern_map<int> p;
}
//----- CUT -----
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: