@@ -78,29 +78,36 @@ class BuiltInNoOp extends BuiltInOperation, @noopexpr {
7878}
7979
8080/**
81- * A C++ `__offsetof` built-in operation (used by some implementations
82- * of `offsetof` in the presence of user-defined `operator &`).
83- *
84- * It computes the offset (in bytes) of data member `m` from the beginning
85- * of its enclosing `struct`/`class`/`union` `st`.
81+ * DEPRECATED: Use `BuiltInOperationBuiltInOffsetOf` instead.
82+ */
83+ deprecated class BuiltInOperationOffsetOf = BuiltInOperationBuiltInOffsetOf ;
84+
85+ /**
86+ * A C/C++ `__offsetof` built-in operation (used by some implementations
87+ * of `offsetof`). The operation retains its semantics even in the presence
88+ * of an overloaded `operator &`). This is a GNU/Clang extension.
8689 * ```
87- * #define offsetof(st, m) __offsetof(st, m)
90+ * struct S {
91+ * int a, b;
92+ * };
93+ * int d = __builtin_offsetof(struct S, b); // usually 4
8894 * ```
8995 */
90- class BuiltInOperationOffsetOf extends BuiltInOperation , @offsetofexpr {
91- override string toString ( ) { result = "__offsetof " }
96+ class BuiltInOperationBuiltInOffsetOf extends BuiltInOperation , @offsetofexpr {
97+ override string toString ( ) { result = "__builtin_offsetof " }
9298
93- override string getCanonicalQLClass ( ) { result = "BuiltInOperationOffsetOf " }
99+ override string getCanonicalQLClass ( ) { result = "BuiltInOperationBuiltInOffsetOf " }
94100}
95101
96102/**
97- * A C/C++ `__INTADDR__` expression, used by EDG to implement `offsetof`
98- * in the presence of user-defined `operator &`.
99- *
100- * It computes the offset (in bytes) of data member `m` from the beginning
101- * of its enclosing `struct`/`class`/`union` `st`.
103+ * A C/C++ `__INTADDR__` built-in operation (used by some implementations
104+ * of `offsetof`). The operation retains its semantics even in the presence
105+ * of an overloaded `operator &`). This is an EDG extension.
102106 * ```
103- * #define offsetof(st, m) __INTADDR__(st, m)
107+ * struct S {
108+ * int a, b;
109+ * };
110+ * int d = __INTADDR__(struct S, b); // usually 4
104111 * ```
105112 */
106113class BuiltInIntAddr extends BuiltInOperation , @intaddrexpr {
@@ -541,7 +548,7 @@ class BuiltInOperationIsDestructible extends BuiltInOperation, @isdestructibleex
541548 * The `__is_nothrow_destructible` built-in operation (used by some
542549 * implementations of the `<type_traits>` header).
543550 *
544- * Returns `true` if the type is destructible and whose constructor , and those
551+ * Returns `true` if the type is destructible and whose destructor , and those
545552 * of member data and any super`class`es all have an empty exception
546553 * specification.
547554 * ```
@@ -558,7 +565,7 @@ class BuiltInOperationIsNothrowDestructible extends BuiltInOperation, @isnothrow
558565 * The `__is_trivially_destructible` built-in operation (used by some
559566 * implementations of the `<type_traits>` header).
560567 *
561- * Returns `true` if the type is destructible and whose constructor , and those
568+ * Returns `true` if the type is destructible and whose destructor , and those
562569 * of member data and any super`class`es are all trivial (compiler-generated).
563570 * ```
564571 * bool v = __is_trivially_destructible(MyType);
@@ -575,8 +582,7 @@ class BuiltInOperationIsTriviallyDestructible extends BuiltInOperation, @istrivi
575582 * implementations of the `<type_traits>` header).
576583 *
577584 * Returns `true` if the assignment operator `C::operator =(const C& c)` is
578- * trivial (compiler-generated). The * generated code will have resembled a
579- * `memcpy` operation.
585+ * trivial (compiler-generated).
580586 * ```
581587 * template<typename T>
582588 * struct is_trivially_assignable
@@ -595,7 +601,7 @@ class BuiltInOperationIsTriviallyAssignable extends BuiltInOperation, @istrivial
595601 * implementations of the `<type_traits>` header).
596602 *
597603 * Returns true if there exists a `C::operator =(const C& c) nothrow`
598- * assignment operator (i.e, with an empty excepion specification).
604+ * assignment operator (i.e, with an empty exception specification).
599605 * ```
600606 * bool v = __is_nothrow_assignable(MyType);
601607 * ```
0 commit comments