public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it
@ 2011-10-30 13:26 schaub.johannes at googlemail dot com
  2011-10-30 13:54 ` [Bug c++/50921] " schaub.johannes at googlemail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: schaub.johannes at googlemail dot com @ 2011-10-30 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50921
           Summary: GCC cannot find dependent conversion-function-id even
                    if there's a using declaration for it
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schaub.johannes@googlemail.com


The following code should compile but doesn't.

------- snip
template<typename T>
struct Type { int x; };

template<typename T>
struct Base {
  operator Type<int>();
};

template<typename T>
struct Derived : Base<T> {
  using Base<T>::operator Type<T>;
  void f() { 
    int x = operator Type<T>().x; 
    (void) x;
  }
};

int main() {
  Derived<int> d;
  d.f();
}
------- snap

Error:
------- snip
main1.cpp:13:30: error: there are no arguments to 'operator Type<T>' that
depend on a template parameter, so a declaration of 'operator Type<T>' must be
available
------- snap

The function call is dependent by the dependent function name itself, it
doesn't need dependent call arguments in this case in order to be dependent.


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

* [Bug c++/50921] GCC cannot find dependent conversion-function-id even if there's a using declaration for it
  2011-10-30 13:26 [Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it schaub.johannes at googlemail dot com
@ 2011-10-30 13:54 ` schaub.johannes at googlemail dot com
  2012-08-24 21:11 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: schaub.johannes at googlemail dot com @ 2011-10-30 13:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Johannes Schaub <schaub.johannes at googlemail dot com> 2011-10-30 13:54:21 UTC ---
Someone notified me that you can substantially reduce this to the following

template<typename T>
struct Base {
  operator int();
};

template<typename T>
struct Derived : Base<T> {
  using Base<T>::operator int;
  void f() { 
    int x = operator int(); 
    (void) x;
  }
};

int main() {
  Derived<int> d;
  d.f();
}

Same diagnostic is given.


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

* [Bug c++/50921] GCC cannot find dependent conversion-function-id even if there's a using declaration for it
  2011-10-30 13:26 [Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it schaub.johannes at googlemail dot com
  2011-10-30 13:54 ` [Bug c++/50921] " schaub.johannes at googlemail dot com
@ 2012-08-24 21:11 ` paolo.carlini at oracle dot com
  2012-08-31 20:04 ` fabien at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-24 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fabien at gcc dot gnu.org

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-24 21:11:13 UTC ---
Fabien, you may be interested in this one.


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

* [Bug c++/50921] GCC cannot find dependent conversion-function-id even if there's a using declaration for it
  2011-10-30 13:26 [Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it schaub.johannes at googlemail dot com
  2011-10-30 13:54 ` [Bug c++/50921] " schaub.johannes at googlemail dot com
  2012-08-24 21:11 ` paolo.carlini at oracle dot com
@ 2012-08-31 20:04 ` fabien at gcc dot gnu.org
  2014-09-09  9:58 ` paolo.carlini at oracle dot com
  2021-08-04  3:38 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: fabien at gcc dot gnu.org @ 2012-08-31 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

fabien at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-08-31
     Ever Confirmed|0                           |1
      Known to fail|                            |4.6.3, 4.7.0, 4.8.0

--- Comment #3 from fabien at gcc dot gnu.org 2012-08-31 20:04:41 UTC ---
(In reply to comment #2)
> Fabien, you may be interested in this one.

Indeed! Thanks for notifying me.


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

* [Bug c++/50921] GCC cannot find dependent conversion-function-id even if there's a using declaration for it
  2011-10-30 13:26 [Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it schaub.johannes at googlemail dot com
                   ` (2 preceding siblings ...)
  2012-08-31 20:04 ` fabien at gcc dot gnu.org
@ 2014-09-09  9:58 ` paolo.carlini at oracle dot com
  2021-08-04  3:38 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-09-09  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paolo.carlini at oracle dot com

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Any news?


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

* [Bug c++/50921] GCC cannot find dependent conversion-function-id even if there's a using declaration for it
  2011-10-30 13:26 [Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it schaub.johannes at googlemail dot com
                   ` (3 preceding siblings ...)
  2014-09-09  9:58 ` paolo.carlini at oracle dot com
@ 2021-08-04  3:38 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04  3:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
      Known to fail|                            |11.1.0
             Status|ASSIGNED                    |NEW
   Last reconfirmed|2012-08-31 00:00:00         |2021-8-3
           Assignee|fabien at gcc dot gnu.org          |unassigned at gcc dot gnu.org

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So it seems like it is only the conversion operators and only if explicitly
called.

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

end of thread, other threads:[~2021-08-04  3:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-30 13:26 [Bug c++/50921] New: GCC cannot find dependent conversion-function-id even if there's a using declaration for it schaub.johannes at googlemail dot com
2011-10-30 13:54 ` [Bug c++/50921] " schaub.johannes at googlemail dot com
2012-08-24 21:11 ` paolo.carlini at oracle dot com
2012-08-31 20:04 ` fabien at gcc dot gnu.org
2014-09-09  9:58 ` paolo.carlini at oracle dot com
2021-08-04  3:38 ` 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).