Skip to content

Commit

Permalink
is_within_lifetime in stdlib + constexpr print (implementation steals…
Browse files Browse the repository at this point in the history
… from llvm#91895 as I thought I have an error)
  • Loading branch information
hanickadot committed Aug 19, 2024
1 parent c76cb33 commit e79cf90
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 122 deletions.
1 change: 1 addition & 0 deletions clang/include/clang/Basic/BuiltinHeaders.def
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ HEADER(STRINGS_H, "strings.h")
HEADER(STRING_H, "string.h")
HEADER(UNISTD_H, "unistd.h")
HEADER(UTILITY, "utility")
HEADER(TYPE_TRAITS, "type_traits")
HEADER(WCHAR_H, "wchar.h")
HEADER(XMMINTRIN_H, "xmmintrin.h")

Expand Down
8 changes: 7 additions & 1 deletion clang/include/clang/Basic/Builtins.td
Original file line number Diff line number Diff line change
Expand Up @@ -4795,6 +4795,12 @@ def PointerTagValue : Builtin {

def IsWithinLifeTime : Builtin {
let Spellings = ["__builtin_is_within_lifetime"];
let Attributes = [Constexpr, NoThrow];
let Attributes = [Consteval, NoThrow];
let Prototype = "bool(void const*)";
}

def ConstexprPrint : Builtin {
let Spellings = ["__constexpr_print"];
let Attributes = [Constexpr, NoThrow];
let Prototype = "void(char const*)";
}
Loading

0 comments on commit e79cf90

Please sign in to comment.