From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
Cc: <gcc@gcc.gnu.org>
Subject: Re: implicit typename warnings with gcc 3.1
Date: Thu, 01 Aug 2002 05:20:00 -0000 [thread overview]
Message-ID: <m3heiehiyc.fsf@soliton.integrable-solutions.net> (raw)
In-Reply-To: Richard Guenther's message of "Thu, 1 Aug 2002 14:04:49 +0200 (CEST)"
Richard Guenther <rguenth@tat.physik.uni-tuebingen.de> writes:
| Hi!
|
| template <int i>
| struct foo {
| typedef int a_t;
| };
|
| template <int i>
| class blubb : public foo<i>
| {
| a_t x;
| };
|
| gives
|
| bellatrix:~/src/tests$ g++ -c implicit.cpp
| implicit.cpp:10: warning: `typename blubb<i>::a_t' is implicitly a
| typename
| implicit.cpp:10: warning: implicit typename is deprecated, please see the
| documentation for details
|
| How am I supposed to fix such cases?
This must be a FAQ. Dependent base names are not examined during the
first phase of name lookup in template codes. That means the above
code is ill-formed, since there is no "a_t" in scope. The incriminated
line should read something like:
typename foo<i>::a_t x;
| Is this a gcc deficiency?
No. The only deficiency I see is that it doesn't issue a hard error ;-)
| Intel C++
| doesnt complain here.
Then, it isn't compliant in that regard.
-- Gaby
next prev parent reply other threads:[~2002-08-01 12:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-01 5:04 Richard Guenther
2002-08-01 5:20 ` Gabriel Dos Reis [this message]
2002-08-01 5:24 ` Richard Guenther
2002-08-03 15:30 ` Nix
2002-08-03 15:43 ` Gabriel Dos Reis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3heiehiyc.fsf@soliton.integrable-solutions.net \
--to=gdr@integrable-solutions.net \
--cc=gcc@gcc.gnu.org \
--cc=rguenth@tat.physik.uni-tuebingen.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).