This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH for c++/44587 (qualified-ids as template arguments)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 12 Nov 2010 07:45:39 -0800
- Subject: Re: C++ PATCH for c++/44587 (qualified-ids as template arguments)
- References: <4C2A4883.email@example.com>
On Tue, Jun 29, 2010 at 12:24 PM, Jason Merrill <firstname.lastname@example.org> wrote:
> In 44587, using a qualified-id naming an array static data member as a
> pointer template argument was causing an ICE. ?When I investigated this, it
> turned out that we weren't doing anything about 184.108.40.206/3:
> A non-integral non-type template-argument is dependent if its type is
> dependent or it has either of the following forms
> ? ? ? ?qualified-id
> ? ? ? ?& qualified-id
> which is somewhat odd because this text was there in C++98.
> Then I noticed that the equivalent testcase using an unqualified-id was
> being miscompiled as well--and that it seems to be a hole in the standard,
> as the address of a static data member is clearly value-dependent, but the
> standard doesn't say that.
> These testcases worked in 4.2, but started going wrong in 4.3.
> So, this patch clarifies that such an address is value-dependent, makes sure
> that we check that before deciding to fold it, and treats a qualified-id
> that names a member of the current instantiation the same as an
> unqualified-id to avoid crashing in lvalue_p.
> Tested x86_64-pc-linux-gnu, applying to 4.4, 4.5 and trunk.