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++/71919] New: Redefinition of user-defined conversions (via typedef) shouldn't compile


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

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