public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50871] New: [C++0x] G++ fails to reject explicitly-defaulted function definition with different exception spec
@ 2011-10-25 22:29 redi at gcc dot gnu.org
  2011-10-26 10:15 ` [Bug c++/50871] [C++0x] G++ fails to reject explicitly-defaulted function definition with different exception spec in system headers paolo.carlini at oracle dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2011-10-25 22:29 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50871
           Summary: [C++0x] G++ fails to reject explicitly-defaulted
                    function definition with different exception spec
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


Preprocessed source, note first line:

# 1 "/" 3

class condvar
{
public:

  condvar() noexcept;
  ~condvar() noexcept;

};

condvar::condvar() = default;
condvar::~condvar() = default;


This should be rejected because the explicitily-defaulted definitions are
missing "noexcept" but it compiles without error:

$ g++ -std=gnu++0x  cv.ii -c
$


If the first line is removed it is rejected:

cv.ii:11:18: error: declaration of ‘condvar::condvar()’ has a different
exception specifier
cv.ii:6:3: error: from previous declaration ‘condvar::condvar() noexcept
(true)’
cv.ii:12:19: error: declaration of ‘condvar::~condvar()’ has a different
exception specifier
cv.ii:7:3: error: from previous declaration ‘condvar::~condvar() noexcept
(true)’


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

end of thread, other threads:[~2014-06-24 15:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-25 22:29 [Bug c++/50871] New: [C++0x] G++ fails to reject explicitly-defaulted function definition with different exception spec redi at gcc dot gnu.org
2011-10-26 10:15 ` [Bug c++/50871] [C++0x] G++ fails to reject explicitly-defaulted function definition with different exception spec in system headers paolo.carlini at oracle dot com
2011-10-26 10:41 ` redi at gcc dot gnu.org
2011-10-26 11:31 ` paolo.carlini at oracle dot com
2011-10-26 13:38 ` jason at gcc dot gnu.org
2011-10-26 13:47 ` redi at gcc dot gnu.org
2011-10-27 13:17 ` paolo.carlini at oracle dot com
2011-10-27 13:31 ` redi at gcc dot gnu.org
2011-10-27 13:35 ` paolo.carlini at oracle dot com
2011-11-10 22:50 ` [Bug libstdc++/50871] " jason at gcc dot gnu.org
2011-12-03 15:35 ` redi at gcc dot gnu.org
2014-04-04 17:06 ` redi at gcc dot gnu.org
2014-06-24 15:00 ` redi 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).