This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/66484] Exception specification can declare a pointer to incomplete type, which is against C++ standard section 15.1


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The relevant text is in 15.4 Exception specifications, p2:

   A type denoted in an exception-specification shall not denote a pointer or
reference to an incomplete type, other than cv void* or a pointer or reference
to a class currently being defined.

The test case below contrasts the diagnostic issued for an ordinary function to
the absence of one for the implicit specialization of the function template.

$ cat u.c && gcc -c -std=c++11 -xc++ u.c
struct S;

void f () throw (S*);

template <class T> void g () throw (T);

void foo () {
    g<S*>();
}
u.c:3:19: warning: invalid use of incomplete type âstruct Sâ
 void f () throw (S*);
                   ^
u.c:1:8: warning: forward declaration of âstruct Sâ
 struct S;
        ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]