ArcsinX marked an inline comment as done.
ArcsinX added inline comments.

================
Comment at: clang/test/Sema/init-ref-c.c:8
+}
\ No newline at end of file

----------------
riccibruno wrote:
> I think it would be better to name this test `varargs-arm.c` since this bug 
> can only happen with the varargs-related builtins (`__builtin_addressof` 
> takes a reference but has custom type-checking).
> 
> Additional test case:
> ```
> const __builtin_va_list cva;
> __builtin_va_end(cva); // expected-error {{binding reference of type 
> '__builtin_va_list' to value of type 'const __builtin_va_list' drops 'const' 
> qualifier}}
> ```
It's not only about ARM, its about `__builtin_va_list` type which depends on 
architecture. E.g. on MIPS it also crashes.

Also it's not about `__builtin_va_*()` and `__builtin_ms_va_*()`,  its about 
builtins with reference parameters, when we pass incompatible C structures to 
these builtin calls. May be there could be other builtins with reference 
parameters in the future.

We could not pass incompatible structure to `__builtin_addressof()` that is the 
reason why we could not reproduce the problem with this builtin.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82805/new/

https://reviews.llvm.org/D82805



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to