public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99262] New: The decltype-specifier that denotes a destructor in a function call is rejected by GCC
@ 2021-02-25  8:00 xmh970252187 at gmail dot com
  2021-02-25  9:51 ` [Bug c++/99262] " redi at gcc dot gnu.org
  2021-08-05  2:24 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: xmh970252187 at gmail dot com @ 2021-02-25  8:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99262
           Summary: The decltype-specifier that denotes a destructor in a
                    function call is rejected by GCC
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xmh970252187 at gmail dot com
  Target Milestone: ---

````cpp
int main(){
  int a = 0;
  a.~decltype(a)();
}
````
This usage is rejected by GCC<https://godbolt.org/z/dj98nb> while it's accepted
by Clang. as per [expr.prim.id#unqual-1], [expr.ref#6.3.2], and [expr.call#5]
> A type-name or decltype-specifier prefixed by ~ denotes the destructor of the type so named; see [expr.prim.id.dtor]. 

> If E2 is a (possibly overloaded) member function, function overload resolution ([over.match]) is used to select the function to which E2 refers. The type of E1.E2 is the type of E2 and E1.E2 refers to the function referred to by E2.
>> Otherwise (when E2 refers to a non-static member function), E1.E2 is a prvalue. The expression can be used only as the left-hand operand of a member function call ([class.mfct]). 

>If the postfix-expression names a destructor or pseudo-destructor ([expr.prim.id.dtor]), the type of the function call expression is void; 

It should be a valid usage.

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

* [Bug c++/99262] The decltype-specifier that denotes a destructor in a function call is rejected by GCC
  2021-02-25  8:00 [Bug c++/99262] New: The decltype-specifier that denotes a destructor in a function call is rejected by GCC xmh970252187 at gmail dot com
@ 2021-02-25  9:51 ` redi at gcc dot gnu.org
  2021-08-05  2:24 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2021-02-25  9:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-02-25
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

* [Bug c++/99262] The decltype-specifier that denotes a destructor in a function call is rejected by GCC
  2021-02-25  8:00 [Bug c++/99262] New: The decltype-specifier that denotes a destructor in a function call is rejected by GCC xmh970252187 at gmail dot com
  2021-02-25  9:51 ` [Bug c++/99262] " redi at gcc dot gnu.org
@ 2021-08-05  2:24 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-05  2:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is a dup of bug 77815.

*** This bug has been marked as a duplicate of bug 77815 ***

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

end of thread, other threads:[~2021-08-05  2:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25  8:00 [Bug c++/99262] New: The decltype-specifier that denotes a destructor in a function call is rejected by GCC xmh970252187 at gmail dot com
2021-02-25  9:51 ` [Bug c++/99262] " redi at gcc dot gnu.org
2021-08-05  2:24 ` 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).