File tree Expand file tree Collapse file tree
cpp/common/src/codingstandards/cpp Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import cpp
66
7+ /**
8+ * A user defined literal operator is a function that defines the behavior of a user defined literal.
9+ * It is declared using the `operator ""` syntax.
10+ * ```
11+ * constexpr long operator""_km(unsigned long value) {
12+ * ...
13+ * }
14+ * ```
15+ */
716class UserDefinedLiteralDeclaration extends Function {
817 UserDefinedLiteralDeclaration ( ) {
918 // We use the '?' in this regexp because CodeQL CLI 2.4.6 and earlier reported these operators
@@ -17,6 +26,12 @@ class UserDefinedLiteralDeclaration extends Function {
1726 predicate hasCompliantSuffix ( ) { this .getName ( ) .regexpMatch ( "operator \"\"?_\\p{Alpha}+" ) }
1827}
1928
29+ /**
30+ * A user defined literal is a literal that is passed as an argument to a call to a user defined literal operator.
31+ * ```
32+ * 1000_km;
33+ * ```
34+ */
2035class UserDefinedLiteral extends Literal {
2136 UserDefinedLiteral ( ) {
2237 exists ( FunctionCall fc |
You can’t perform that action at this time.
0 commit comments