Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5b9dca

Browse files
committed
C++: add Class::isStandardLayout()
1 parent 440d64d commit e5b9dca

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

cpp/ql/src/semmle/code/cpp/Class.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ class Class extends UserType {
418418
*/
419419
predicate isPOD() { is_pod_class(underlyingElement(this)) }
420420

421+
/**
422+
* Holds if this class is a standard-layout class [N4140 9(7)]. Also holds
423+
* for structs in C programs.
424+
*/
425+
predicate isStandardLayout() { is_standard_layout_class(underlyingElement(this)) }
426+
421427
/**
422428
* Holds if this class is abstract, in other words whether it declares one
423429
* or more pure virtual member functions.

cpp/ql/src/semmlecode.cpp.dbscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ usertype_uuid(
691691
);
692692

693693
is_pod_class(unique int id: @usertype ref);
694+
is_standard_layout_class(unique int id: @usertype ref);
694695

695696
is_complete(unique int id: @usertype ref);
696697

0 commit comments

Comments
 (0)