This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug c++/36576] gcc 4.3.1 doesn't build for me on openSUSE 10.3
- From: "karx11erx at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 20 Jun 2008 13:03:34 -0000
- Subject: [Bug c++/36576] gcc 4.3.1 doesn't build for me on openSUSE 10.3
- References: <bug-36576-16337@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from karx11erx at hotmail dot com 2008-06-20 13:03 -------
(In reply to comment #11)
> > There is also no ambiguity in this:
>
> Why that is invalid code is shown on http://gcc.gnu.org/gcc-3.4/changes.html .
>
> (In reply to comment #9)
> > Which rule is forbidding this:
> >
> > template <class T> class CTest {
> > struct test {
> > int i;
> > } test *testptr;
> > };
>
> For this, you have a variable that is test and then *testptr which does not
> make sense. Try it in a non template and you will see that it is invalid code.
>
I have read the rule that enforces "this->" dereferencing - for the sake of
resolving ambiguity. There is no ambiguity in the above declaration though.
The struct variable/pointer variable declaration declares two variables at
once, where the latter can be changed whenever seen fit. I can't see why it
shouldn't make sense (but I may add to my defense that I haven't written that
code and never would have written code like that: It is my ungrateful task to
make it fit for gcc 4). Anyway, gcc 4 is the only compiler we found yet to
reject this code. Well, stuff like that shouldn't appear to often, so we can
manually fix it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36576