public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97014] New: Class NTTPs not demangled in the compilation error
@ 2020-09-10 22:18 mateusz.pusz at gmail dot com
  2020-10-01 17:14 ` [Bug c++/97014] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mateusz.pusz at gmail dot com @ 2020-09-10 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97014
           Summary: Class NTTPs not demangled in the compilation error
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mateusz.pusz at gmail dot com
  Target Milestone: ---

The following code:

```
struct ratio {
  int num;
  int den;
};

template<ratio R>
struct X {
  static constexpr auto ratio = R;
};

template<ratio R>
concept positive = R.num > 0 && R.den > 0;

template<typename T>
concept ratio_positive = positive<T::ratio>;

void foo(ratio_positive auto x) {}

void boo()
{
  foo(X<ratio(-1, 2)>());
}
```

produces the following error with `::_ZTAXtl5ratioLin1ELi2EEE` not demangled to
`ratio{-1, 2}` in many places:

```
<source>: In function 'void boo()':
<source>:21:24: error: no matching function for call to 'foo(X<ratio{-1, 2}>)'
   21 |   foo(X<ratio(-1, 2)>());
      |                        ^
<source>:17:6: note: candidate: 'template<class auto:1>  requires 
ratio_positive<auto:1> void foo(auto:1)'
   17 | void foo(ratio_positive auto x) {}
      |      ^~~
<source>:17:6: note:   template argument deduction/substitution failed:
<source>:17:6: note: constraints not satisfied
<source>: In substitution of 'template<class auto:1>  requires 
ratio_positive<auto:1> void foo(auto:1) [with auto:1 = X<ratio{-1, 2}>]':
<source>:21:24:   required from here
<source>:12:9:   required for the satisfaction of 'positive<T::ratio>' [with T
= X<::_ZTAXtl5ratioLin1ELi2EEE>]
<source>:15:9:   required for the satisfaction of 'ratio_positive<auto:1>'
[with auto:1 = X<::_ZTAXtl5ratioLin1ELi2EEE>]
<source>:12:26: note: the expression '((const ratio)R).num > 0 [with R =
X<::_ZTAXtl5ratioLin1ELi2EEE>::ratio]' evaluated to 'false'
   12 | concept positive = R.num > 0 && R.den > 0;
      |                    ~~~~~~^~~
Compiler returned: 1
```

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

* [Bug c++/97014] Class NTTPs not demangled in the compilation error
  2020-09-10 22:18 [Bug c++/97014] New: Class NTTPs not demangled in the compilation error mateusz.pusz at gmail dot com
@ 2020-10-01 17:14 ` mpolacek at gcc dot gnu.org
  2020-10-01 20:32 ` mpolacek at gcc dot gnu.org
  2020-10-02 22:52 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-10-01 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |diagnostic
   Last reconfirmed|                            |2020-10-01

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

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

* [Bug c++/97014] Class NTTPs not demangled in the compilation error
  2020-09-10 22:18 [Bug c++/97014] New: Class NTTPs not demangled in the compilation error mateusz.pusz at gmail dot com
  2020-10-01 17:14 ` [Bug c++/97014] " mpolacek at gcc dot gnu.org
@ 2020-10-01 20:32 ` mpolacek at gcc dot gnu.org
  2020-10-02 22:52 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-10-01 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

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

* [Bug c++/97014] Class NTTPs not demangled in the compilation error
  2020-09-10 22:18 [Bug c++/97014] New: Class NTTPs not demangled in the compilation error mateusz.pusz at gmail dot com
  2020-10-01 17:14 ` [Bug c++/97014] " mpolacek at gcc dot gnu.org
  2020-10-01 20:32 ` mpolacek at gcc dot gnu.org
@ 2020-10-02 22:52 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-10-02 22:52 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed 47f09ec9717058ada97be33bcbb23ceb6322ba61

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

end of thread, other threads:[~2020-10-02 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 22:18 [Bug c++/97014] New: Class NTTPs not demangled in the compilation error mateusz.pusz at gmail dot com
2020-10-01 17:14 ` [Bug c++/97014] " mpolacek at gcc dot gnu.org
2020-10-01 20:32 ` mpolacek at gcc dot gnu.org
2020-10-02 22:52 ` mpolacek 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).