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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-12-19
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
enum { X };

struct S { 
  template <typename T>
  void f(T) { unsigned int g(X ?: g); }
};

struct S2 { 
  S m;
  void l() { m.f(1); }
};

$ ./cc1plus -quiet -Wall -Wextra 92974.C
92974.C: In member function ‘void S::f(T)’:
92974.C:5:32: warning: enumerated and non-enumerated type in conditional
expression [-Wextra]
    5 |   void f(T) { unsigned int g(X ?: g); }
      |                              ~~^~~~
92974.C: In instantiation of ‘void S::f(T) [with T = int]’:
92974.C:10:19:   required from here
cc1plus: warning: enumerated and non-enumerated type in conditional expression
[-Wextra]

Reply via email to