public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66484] New: Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1
@ 2015-06-10  9:59 bluechristlove at 163 dot com
  2015-06-10 15:35 ` [Bug c++/66484] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bluechristlove at 163 dot com @ 2015-06-10  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66484
           Summary: Exception specification can declare a pointer to
                    incomplete type, which is against C++ standard section
                    15.1
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bluechristlove at 163 dot com
  Target Milestone: ---

In the C++11 standard 15.1.3 Throwing an exception, the standard says that:  If
the
type of the exception object would be an incomplete type or a pointer to an
incomplete type other than (possibly cv-qualified) void the program is
ill-formed.

So if we write the code like this:

[code]

class C;
template <class ...T> void f(T...) throw(T...) {}
void g(C* p) { f(1,p); }

int main()
{   
}

[/code]


This should not be passed, because p is a pointer to incomplete type of C, but
gcc can pass this case.

However, if we compile this case using clang, clang will emit error like this:

main.cpp:2:46: error: pointer to incomplete type 'C' is not allowed in
exception specification
template <class ...T> void f(T...) throw(T...) {}


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

* [Bug c++/66484] Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1
  2015-06-10  9:59 [Bug c++/66484] New: Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1 bluechristlove at 163 dot com
@ 2015-06-10 15:35 ` redi at gcc dot gnu.org
  2021-08-04 21:31 ` pinskia at gcc dot gnu.org
  2021-08-05 11:21 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2015-06-10 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-06-10
     Ever confirmed|0                           |1


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

* [Bug c++/66484] Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1
  2015-06-10  9:59 [Bug c++/66484] New: Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1 bluechristlove at 163 dot com
  2015-06-10 15:35 ` [Bug c++/66484] " redi at gcc dot gnu.org
@ 2021-08-04 21:31 ` pinskia at gcc dot gnu.org
  2021-08-05 11:21 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04 21:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
We have been erroring out with -pedantic-errors since at least GCC 5.1.0.
The question becomes do we want to turn this into a non-pedwarn and do we care
enough about throw() since they are deprecated in C++11 and the default C++
standard in GCC11+ is C++17 where throw() is no longer supported?

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

* [Bug c++/66484] Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1
  2015-06-10  9:59 [Bug c++/66484] New: Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1 bluechristlove at 163 dot com
  2015-06-10 15:35 ` [Bug c++/66484] " redi at gcc dot gnu.org
  2021-08-04 21:31 ` pinskia at gcc dot gnu.org
@ 2021-08-05 11:21 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-05 11:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
IMO no, a pedwarn is ok, and we shouldn't waste effort on better support for
dynamic exception specs.

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10  9:59 [Bug c++/66484] New: Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1 bluechristlove at 163 dot com
2015-06-10 15:35 ` [Bug c++/66484] " redi at gcc dot gnu.org
2021-08-04 21:31 ` pinskia at gcc dot gnu.org
2021-08-05 11:21 ` 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).