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; }
};