[Bug c++/69372] New: GCC allows array and function types to be caught by reference.
eric at efcs dot ca
gcc-bugzilla@gcc.gnu.org
Wed Jan 20 03:32:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69372
Bug ID: 69372
Summary: GCC allows array and function types to be caught by
reference.
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eric at efcs dot ca
Target Milestone: ---
Created attachment 37396
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37396&action=edit
reproducer for array types
The current C++ draft states:
[expr.throw]/p2 states:
> Evaluating a throw-expression with an operand throws an exception (15.1); the type of the exception object
> is determined by removing any top-level cv-qualifiers from the static type of the operand and adjusting the
> type from “array of T” or function type T to “pointer to T”.
Therefore it should not be possible to catch a function or array by reference.
However GCC allows this.
More information about the Gcc-bugs
mailing list