asmok-g wrote:

@AaronBallman If you try to compile the following program after this patch
```
void free ();
typedef enum {REG_EESCAPE} reg_errcode_t;
typedef struct {int *stack;} compile_stack_type;
reg_errcode_t byte_regex_compile () {
  compile_stack_type compile_stack;
  return (free (compile_stack.stack), REG_EESCAPE);                             
                                                                                
                   
}
```
cmd: `clang  -Wimplicit-int-enum-cast  -c pre.i`

It will give an incorrect diagnostic:
```
pre.i:6:37: warning: implicit conversion from 'int' to enumeration type 
'reg_errcode_t' is invalid in C++ [-Wimplicit-int-enum-cast]
    6 |   return (free (compile_stack.stack), REG_EESCAPE);                     
                                                                                
                           
      |   ~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
1 warning generated.
```

https://github.com/llvm/llvm-project/pull/137658
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to