public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34406] New: [reject valid?] incomplete type 'Y' used in nested name specifier.
@ 2007-12-09 13:11 pluto at agmk dot net
2008-01-13 2:52 ` [Bug c++/34406] " bangerth at dealii dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: pluto at agmk dot net @ 2007-12-09 13:11 UTC (permalink / raw)
To: gcc-bugs
template < typename T, typename C, C T::*F >
struct X
{
};
struct Y
{
typedef X< Y, int, &Y::field_ > Z;
int field_;
};
gcc-4.1 reports:
t.cpp:8: error: incomplete type 'Y' used in nested name specifier
t.cpp:8: error: template argument 3 is invalid
comeau online:
"ComeauTest.c", line 8: error: class "Y" has no member "field_"
typedef X< Y, int, &Y::field_ > Z;
msvc8:
t.cpp(8) : error C2065: 'field_' : undeclared identifier
after moving the 'int field_' before typedef:
gcc and comeau accepts code, while msvc8 still rejects with:
t.cpp(9) : error C2327: 'Y::field_' : is not a type name, static, or enumerator
t.cpp(9) : error C2065: 'field_' : undeclared identifier
could someone throw some light please?
--
Summary: [reject valid?] incomplete type 'Y' used in nested name
specifier.
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34406
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/34406] [reject valid?] incomplete type 'Y' used in nested name specifier.
2007-12-09 13:11 [Bug c++/34406] New: [reject valid?] incomplete type 'Y' used in nested name specifier pluto at agmk dot net
@ 2008-01-13 2:52 ` bangerth at dealii dot org
2008-01-13 11:19 ` pluto at agmk dot net
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2008-01-13 2:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from bangerth at dealii dot org 2008-01-13 02:33 -------
What is the question you want to ask? The first code you show is invalid,
the second valid...
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34406
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/34406] [reject valid?] incomplete type 'Y' used in nested name specifier.
2007-12-09 13:11 [Bug c++/34406] New: [reject valid?] incomplete type 'Y' used in nested name specifier pluto at agmk dot net
2008-01-13 2:52 ` [Bug c++/34406] " bangerth at dealii dot org
@ 2008-01-13 11:19 ` pluto at agmk dot net
2008-01-13 16:37 ` bangerth at dealii dot org
2008-01-13 21:37 ` pluto at agmk dot net
3 siblings, 0 replies; 5+ messages in thread
From: pluto at agmk dot net @ 2008-01-13 11:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pluto at agmk dot net 2008-01-13 10:23 -------
(In reply to comment #1)
> What is the question you want to ask? The first code you show is invalid,
> the second valid...
i'd ask why the first code is invalid?
class Y looks pretty complete so why typedef expression throws an error?
could you please redirect me to the appropriate paragraph in c++ standard?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34406
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/34406] [reject valid?] incomplete type 'Y' used in nested name specifier.
2007-12-09 13:11 [Bug c++/34406] New: [reject valid?] incomplete type 'Y' used in nested name specifier pluto at agmk dot net
2008-01-13 2:52 ` [Bug c++/34406] " bangerth at dealii dot org
2008-01-13 11:19 ` pluto at agmk dot net
@ 2008-01-13 16:37 ` bangerth at dealii dot org
2008-01-13 21:37 ` pluto at agmk dot net
3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2008-01-13 16:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from bangerth at dealii dot org 2008-01-13 16:31 -------
(In reply to comment #2)
> i'd ask why the first code is invalid?
> class Y looks pretty complete so why typedef expression throws an error?
A class is complete at the closing brace. You use it before that.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34406
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/34406] [reject valid?] incomplete type 'Y' used in nested name specifier.
2007-12-09 13:11 [Bug c++/34406] New: [reject valid?] incomplete type 'Y' used in nested name specifier pluto at agmk dot net
` (2 preceding siblings ...)
2008-01-13 16:37 ` bangerth at dealii dot org
@ 2008-01-13 21:37 ` pluto at agmk dot net
3 siblings, 0 replies; 5+ messages in thread
From: pluto at agmk dot net @ 2008-01-13 21:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pluto at agmk dot net 2008-01-13 21:07 -------
invalid testcase.
--
pluto at agmk dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34406
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-01-13 21:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-09 13:11 [Bug c++/34406] New: [reject valid?] incomplete type 'Y' used in nested name specifier pluto at agmk dot net
2008-01-13 2:52 ` [Bug c++/34406] " bangerth at dealii dot org
2008-01-13 11:19 ` pluto at agmk dot net
2008-01-13 16:37 ` bangerth at dealii dot org
2008-01-13 21:37 ` pluto at agmk dot net
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).