public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49450] New: not possible to call explicit destructor of std::string
@ 2011-06-17 11:03 jwillemsen at remedy dot nl
  2011-06-17 11:33 ` [Bug c++/49450] " jwillemsen at remedy dot nl
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jwillemsen at remedy dot nl @ 2011-06-17 11:03 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: not possible to call explicit destructor of
                    std::string
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jwillemsen@remedy.nl


We want to use C++0x unions with a std::string as member (see for example
http://www2.research.att.com/~bs/C++0xFAQ.html#unions). At the moment we want
to call the ~string we get an error.

Reproducer:

#include <string>

int main ()
{
        std::string s;
        s.~string();
        return 0;
}

message

g++-4.6 -c t.cpp
t.cpp: In function ‘int main()’:
t.cpp:6:11: error: expected class-name before ‘(’ token


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

* [Bug c++/49450] not possible to call explicit destructor of std::string
  2011-06-17 11:03 [Bug c++/49450] New: not possible to call explicit destructor of std::string jwillemsen at remedy dot nl
@ 2011-06-17 11:33 ` jwillemsen at remedy dot nl
  2011-06-17 13:33 ` daniel.kruegler at googlemail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jwillemsen at remedy dot nl @ 2011-06-17 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Johnny Willemsen <jwillemsen at remedy dot nl> 2011-06-17 11:32:51 UTC ---
g++-4.6 (SUSE Linux) 4.6.0 20110505 [gcc-4_6-branch revision 173419]
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


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

* [Bug c++/49450] not possible to call explicit destructor of std::string
  2011-06-17 11:03 [Bug c++/49450] New: not possible to call explicit destructor of std::string jwillemsen at remedy dot nl
  2011-06-17 11:33 ` [Bug c++/49450] " jwillemsen at remedy dot nl
@ 2011-06-17 13:33 ` daniel.kruegler at googlemail dot com
  2011-06-17 13:35 ` jwillemsen at remedy dot nl
  2011-06-17 13:40 ` jwillemsen at remedy dot nl
  3 siblings, 0 replies; 5+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-06-17 13:33 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-06-17 13:32:44 UTC ---
(In reply to comment #0)
> We want to use C++0x unions with a std::string as member (see for example
> http://www2.research.att.com/~bs/C++0xFAQ.html#unions). At the moment we want
> to call the ~string we get an error.

Your program is not conforming according to the standard. You need to write

s.std::string::~string();

instead.


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

* [Bug c++/49450] not possible to call explicit destructor of std::string
  2011-06-17 11:03 [Bug c++/49450] New: not possible to call explicit destructor of std::string jwillemsen at remedy dot nl
  2011-06-17 11:33 ` [Bug c++/49450] " jwillemsen at remedy dot nl
  2011-06-17 13:33 ` daniel.kruegler at googlemail dot com
@ 2011-06-17 13:35 ` jwillemsen at remedy dot nl
  2011-06-17 13:40 ` jwillemsen at remedy dot nl
  3 siblings, 0 replies; 5+ messages in thread
From: jwillemsen at remedy dot nl @ 2011-06-17 13:35 UTC (permalink / raw)
  To: gcc-bugs

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

Johnny Willemsen <jwillemsen at remedy dot nl> changed:

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

--- Comment #3 from Johnny Willemsen <jwillemsen at remedy dot nl> 2011-06-17 13:34:58 UTC ---
user error


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

* [Bug c++/49450] not possible to call explicit destructor of std::string
  2011-06-17 11:03 [Bug c++/49450] New: not possible to call explicit destructor of std::string jwillemsen at remedy dot nl
                   ` (2 preceding siblings ...)
  2011-06-17 13:35 ` jwillemsen at remedy dot nl
@ 2011-06-17 13:40 ` jwillemsen at remedy dot nl
  3 siblings, 0 replies; 5+ messages in thread
From: jwillemsen at remedy dot nl @ 2011-06-17 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

Johnny Willemsen <jwillemsen at remedy dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |INVALID

--- Comment #4 from Johnny Willemsen <jwillemsen at remedy dot nl> 2011-06-17 13:39:20 UTC ---
correct status


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

end of thread, other threads:[~2011-06-17 13:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-17 11:03 [Bug c++/49450] New: not possible to call explicit destructor of std::string jwillemsen at remedy dot nl
2011-06-17 11:33 ` [Bug c++/49450] " jwillemsen at remedy dot nl
2011-06-17 13:33 ` daniel.kruegler at googlemail dot com
2011-06-17 13:35 ` jwillemsen at remedy dot nl
2011-06-17 13:40 ` jwillemsen at remedy dot nl

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