public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca
@ 2022-07-04  9:42 marxin at gcc dot gnu.org
  2022-07-04  9:42 ` [Bug c++/106179] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-04  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106179
           Summary: [13 Regression] Rejected code since
                    r13-1390-g07ac550393d00fca
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jason at gcc dot gnu.org, slyfox at gcc dot gnu.org
  Target Milestone: ---

The following is rejected:

$ cat algo.ii
struct Mat {
  template <typename> Mat();
};
template <typename> struct Mat_;
template <typename _Tp> Mat::Mat() {
  _Tp commaInitializer = commaInitializer.operator Mat_<_Tp>;
}

$ g++ algo.ii -c
algo.ii: In constructor ‘Mat::Mat()’:
algo.ii:6:52: error: invalid template-id
    6 |   _Tp commaInitializer = commaInitializer.operator Mat_<_Tp>;
      |                                                    ^~~~

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

* [Bug c++/106179] [13 Regression] Rejected code since r13-1390-g07ac550393d00fca
  2022-07-04  9:42 [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca marxin at gcc dot gnu.org
@ 2022-07-04  9:42 ` marxin at gcc dot gnu.org
  2022-07-04  9:46 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-04  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-07-04
     Ever confirmed|0                           |1
   Target Milestone|---                         |13.0

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

* [Bug c++/106179] [13 Regression] Rejected code since r13-1390-g07ac550393d00fca
  2022-07-04  9:42 [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca marxin at gcc dot gnu.org
  2022-07-04  9:42 ` [Bug c++/106179] " marxin at gcc dot gnu.org
@ 2022-07-04  9:46 ` redi at gcc dot gnu.org
  2022-07-04 11:59 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-07-04  9:46 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |13.0
      Known to work|                            |12.1.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This should be valid, although I don't know why they wrote it that way instead
of the more idiomatic and simple way: static_cast<Mat_<_Tp>>(commaInitializer)

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

* [Bug c++/106179] [13 Regression] Rejected code since r13-1390-g07ac550393d00fca
  2022-07-04  9:42 [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca marxin at gcc dot gnu.org
  2022-07-04  9:42 ` [Bug c++/106179] " marxin at gcc dot gnu.org
  2022-07-04  9:46 ` redi at gcc dot gnu.org
@ 2022-07-04 11:59 ` rguenth at gcc dot gnu.org
  2022-07-05 21:27 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-04 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug c++/106179] [13 Regression] Rejected code since r13-1390-g07ac550393d00fca
  2022-07-04  9:42 [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-07-04 11:59 ` rguenth at gcc dot gnu.org
@ 2022-07-05 21:27 ` jason at gcc dot gnu.org
  2022-07-06  4:40 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2022-07-05 21:27 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
The P1787 scope/lookup overhaul clarified that Mat_ in .operator Mat_ is looked
up in the same way as a name mentioned immediately after the ., and since
commaInitializer has dependent type _Tp, we don't know whether "Mat_" is
supposed to name a member type of _Tp or the Mat_ in the enclosing scope, so we
don't know if it's a template.  Except that it has to be a type, so it has to
be a template.  So yes, it should work.

As should this:

template <class T> struct Mat {
  Mat();
};

//template <typename> struct Mat_;                                              
template <typename _Tp> Mat<_Tp>::Mat() {
  auto commaInitializer = _Tp().operator Mat_<_Tp>();
}

struct A
{
  template <class T> struct Mat_ { };
  template <class T> operator Mat_<T>();
};

Mat<A> m;

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

* [Bug c++/106179] [13 Regression] Rejected code since r13-1390-g07ac550393d00fca
  2022-07-04  9:42 [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-07-05 21:27 ` jason at gcc dot gnu.org
@ 2022-07-06  4:40 ` cvs-commit at gcc dot gnu.org
  2022-07-06  4:40 ` jason at gcc dot gnu.org
  2022-07-06  4:43 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-06  4:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:656c0212909bc91b1025aa12774d981adb531b4c

commit r13-1516-g656c0212909bc91b1025aa12774d981adb531b4c
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Jul 5 17:05:47 2022 -0400

    c++: dependent conversion operator lookup [PR106179]

    This testcase demonstrates that my assumption that we would only be
    interested in a class template lookup if the template-id is followed by ::
    was wrong.

            PR c++/106179
            PR c++/106024

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_lookup_name): Remove :: requirement
            for using unqualified lookup result.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/operator16.C: New test.

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

* [Bug c++/106179] [13 Regression] Rejected code since r13-1390-g07ac550393d00fca
  2022-07-04  9:42 [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-07-06  4:40 ` cvs-commit at gcc dot gnu.org
@ 2022-07-06  4:40 ` jason at gcc dot gnu.org
  2022-07-06  4:43 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2022-07-06  4:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.

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

* [Bug c++/106179] [13 Regression] Rejected code since r13-1390-g07ac550393d00fca
  2022-07-04  9:42 [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-07-06  4:40 ` jason at gcc dot gnu.org
@ 2022-07-06  4:43 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2022-07-06  4:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
*** Bug 106178 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2022-07-06  4:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04  9:42 [Bug c++/106179] New: [13 Regression] Rejected code since r13-1390-g07ac550393d00fca marxin at gcc dot gnu.org
2022-07-04  9:42 ` [Bug c++/106179] " marxin at gcc dot gnu.org
2022-07-04  9:46 ` redi at gcc dot gnu.org
2022-07-04 11:59 ` rguenth at gcc dot gnu.org
2022-07-05 21:27 ` jason at gcc dot gnu.org
2022-07-06  4:40 ` cvs-commit at gcc dot gnu.org
2022-07-06  4:40 ` jason at gcc dot gnu.org
2022-07-06  4:43 ` jason 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).