This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71919] New: Redefinition of user-defined conversions (via typedef) shouldn't compile
- From: "jmgao at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Jul 2016 18:10:50 +0000
- Subject: [Bug c++/71919] New: Redefinition of user-defined conversions (via typedef) shouldn't compile
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71919
Bug ID: 71919
Summary: Redefinition of user-defined conversions (via typedef)
shouldn't compile
Product: gcc
Version: 6.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jmgao at google dot com
Target Milestone: ---
GCC does not emit an error (or warning) when two user-defined conversion
functions are defined inline with the same type via typedef. When one or more
of the functions don't have inline definitions, an error happens as expected.
Example (also at https://godbolt.org/g/YYOqja):
typedef int foo;
struct bar {
operator int() { return 0; }
operator foo() { return 0; }
};