File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,10 @@ Bug Fixes to Compiler Builtins
354354
355355- The behvaiour of ``__add_pointer `` and ``__remove_pointer `` for Objective-C++'s ``id `` and interfaces has been fixed.
356356
357+ - The signature for ``__builtin___clear_cache `` was changed from
358+ ``void(char *, char *) `` to ``void(void *, void *) `` to match GCC's signature
359+ for the same builtin. (#GH47833)
360+
357361Bug Fixes to Attribute Support
358362^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
359363 - Fixed crash when a parameter to the ``clang::annotate `` attribute evaluates to ``void ``. See #GH119125
Original file line number Diff line number Diff line change @@ -920,7 +920,7 @@ def FrameAddress : Builtin {
920920def ClearCache : Builtin {
921921 let Spellings = [" __builtin___clear_cache" ];
922922 let Attributes = [NoThrow];
923- let Prototype = " void(char *, char *)" ;
923+ let Prototype = " void(void *, void *)" ;
924924}
925925
926926def BuiltinSetjmp : Builtin {
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -fsyntax-only -verify %s
2+
3+ // Ensure that __builtin___clear_cache has the expected signature. Clang used
4+ // to have a signature accepting char * while GCC had a signature accepting
5+ // void * that was documented incorrectly.
6+ void test (void ) {
7+ int n = 0 ;
8+ __builtin___clear_cache (& n , & n + 1 ); // Ok
9+
10+ __builtin___clear_cache ((const void * )& n , (const void * )(& n + 1 )); // expected-warning 2 {{passing 'const void *' to parameter of type 'void *' discards qualifiers}}
11+ }
12+
You can’t perform that action at this time.
0 commit comments