Skip to content

Commit

Permalink
Merge pull request #14217 from alexet/is-trivial-built-in
Browse files Browse the repository at this point in the history
CPP:Make __is_trivial a builtin operation.
  • Loading branch information
MathiasVP authored Sep 15, 2023
2 parents f160c6c + d79a2c7 commit cdf5872
Show file tree
Hide file tree
Showing 10 changed files with 8,884 additions and 0 deletions.
2,213 changes: 2,213 additions & 0 deletions cpp/downgrades/dbe9c8eb5fc6f54b7ae08c7317d0795b24961564/old.dbscheme

Large diffs are not rendered by default.

2,212 changes: 2,212 additions & 0 deletions cpp/downgrades/dbe9c8eb5fc6f54b7ae08c7317d0795b24961564/semmlecode.cpp.dbscheme

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
description: Make __is_trivial a builtin operation
compatibility: full
18 changes: 18 additions & 0 deletions cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1547,3 +1547,21 @@ class BuiltInBitCast extends BuiltInOperation, @builtinbitcast {

override string getAPrimaryQlClass() { result = "BuiltInBitCast" }
}

/**
* A C++ `__is_trivial` built-in operation (used by some implementations of the
* `<type_traits>` header).
*
* Returns `true` if a type is a trivial type.
* ```
* template<typename _Tp>
* struct is_trivial
* : public integral_constant<bool, __is_trivial(_Tp)>
* {};
* ```
*/
class BuiltInIsTrivial extends BuiltInOperation, @istrivialexpr {
override string toString() { result = "__is_trivial" }

override string getAPrimaryQlClass() { result = "BuiltInIsTrivial" }
}
1 change: 1 addition & 0 deletions cpp/ql/lib/semmlecode.cpp.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,7 @@ case @expr.kind of
| @istriviallydestructibleexpr
| @istriviallyassignableexpr
| @isnothrowassignableexpr
| @istrivialexpr
| @isstandardlayoutexpr
| @istriviallycopyableexpr
| @isliteraltypeexpr
Expand Down
Loading

0 comments on commit cdf5872

Please sign in to comment.