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
354
354
355
355
- The behvaiour of ``__add_pointer `` and ``__remove_pointer `` for Objective-C++'s ``id `` and interfaces has been fixed.
356
356
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
+
357
361
Bug Fixes to Attribute Support
358
362
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
359
363
- 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 {
920
920
def ClearCache : Builtin {
921
921
let Spellings = [" __builtin___clear_cache" ];
922
922
let Attributes = [NoThrow];
923
- let Prototype = " void(char *, char *)" ;
923
+ let Prototype = " void(void *, void *)" ;
924
924
}
925
925
926
926
def 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