주요 콘텐츠

Cpp.NewExpression Class

Namespace: Cpp
Superclasses: AstNodeProperties

Represents the new_expression nodes in the syntax tree of your code

Since R2026a

Description

The PQL class Cpp.NewExpression represents the node new_expression in the syntax tree of your code.

struct MyClass {
  MyClass(int, int) {}
};
void foo() {
  int *a = new int;
  int *b = new int[10];
  MyClass *c = new MyClass(1, 2);
  MyClass *d = new(ptr) MyClass;
}

The example contains four new_expression occurrences. Each new expression in the code corresponds to a Cpp.NewExpression node.

Predicates

expand all

Version History

Introduced in R2026a