public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53251] New: template keyword ignored between -> and member under name collision with non-member
@ 2012-05-06  1:05 potswa at mac dot com
  2012-05-06  1:06 ` [Bug c++/53251] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: potswa at mac dot com @ 2012-05-06  1:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53251

             Bug #: 53251
           Summary: template keyword ignored between -> and member under
                    name collision with non-member
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: potswa@mac.com


Minimal testcase:

template< typename >
class set;

template< typename >
struct b {
    template<typename T>
    void set();
};

template<typename T>
struct d : b<T> {
    d() { this->template set<int>(); }
};

int main()
    { d<int> s; }

Diagnostic:

In constructor ‘d<T>::d()’:
12:17: error: invalid use of ‘class set<int>’

The name "set" is looked up in the context of the expression, outside the
class, perhaps per §3.4.5/1 [basic.lookup.classref]. Furthermore, a class found
by lookup in expression scope per 3.4.5/1 must agree with lookup in class scope
anyway (i.e. it must be a base class if class scope lookup succeeds) or the
program is ill-formed.

3.4.5/1 does not apply because the template keyword is used to mark a dependent
object expression. I suspect that somehow the hint carried by the keyword isn't
properly restricting name lookup.

For deeper discussion see http://stackoverflow.com/questions/10426428 .


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/53251] template keyword ignored between -> and member under name collision with non-member
  2012-05-06  1:05 [Bug c++/53251] New: template keyword ignored between -> and member under name collision with non-member potswa at mac dot com
@ 2012-05-06  1:06 ` pinskia at gcc dot gnu.org
  2012-05-06  1:11 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-06  1:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53251

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-06 01:04:58 UTC ---
Related to PR 11814 .


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/53251] template keyword ignored between -> and member under name collision with non-member
  2012-05-06  1:05 [Bug c++/53251] New: template keyword ignored between -> and member under name collision with non-member potswa at mac dot com
  2012-05-06  1:06 ` [Bug c++/53251] " pinskia at gcc dot gnu.org
@ 2012-05-06  1:11 ` pinskia at gcc dot gnu.org
  2021-08-04  6:27 ` pinskia at gcc dot gnu.org
  2024-04-06 22:49 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-06  1:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53251

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-06 01:06:00 UTC ---
And PR 10200 .


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/53251] template keyword ignored between -> and member under name collision with non-member
  2012-05-06  1:05 [Bug c++/53251] New: template keyword ignored between -> and member under name collision with non-member potswa at mac dot com
  2012-05-06  1:06 ` [Bug c++/53251] " pinskia at gcc dot gnu.org
  2012-05-06  1:11 ` pinskia at gcc dot gnu.org
@ 2021-08-04  6:27 ` pinskia at gcc dot gnu.org
  2024-04-06 22:49 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04  6:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53251

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
      Known to fail|                            |6.4.0, 7.1.0
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=54769,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=81204,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=81257
   Target Milestone|---                         |7.2
         Resolution|---                         |FIXED
      Known to work|                            |7.2.0
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 7.2 by the patch which fixed PR 54769.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/53251] template keyword ignored between -> and member under name collision with non-member
  2012-05-06  1:05 [Bug c++/53251] New: template keyword ignored between -> and member under name collision with non-member potswa at mac dot com
                   ` (2 preceding siblings ...)
  2021-08-04  6:27 ` pinskia at gcc dot gnu.org
@ 2024-04-06 22:49 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-06 22:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53251

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ramon.garcia.f+gcc at gmail dot co
                   |                            |m

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 81526 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-06 22:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-06  1:05 [Bug c++/53251] New: template keyword ignored between -> and member under name collision with non-member potswa at mac dot com
2012-05-06  1:06 ` [Bug c++/53251] " pinskia at gcc dot gnu.org
2012-05-06  1:11 ` pinskia at gcc dot gnu.org
2021-08-04  6:27 ` pinskia at gcc dot gnu.org
2024-04-06 22:49 ` pinskia at gcc dot gnu.org

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).