Skip to content

Commit aae7003

Browse files
committed
Use codingstandards.cpp.UserDefinedLiteral
1 parent acc2856 commit aae7003

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cpp/common/src/codingstandards/cpp/Cpp14Literal.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
*/
66
module Cpp14Literal {
77
private import cpp as StandardLibrary
8+
private import codingstandards.cpp.UserDefinedLiteral
89

9-
/** A numeric literal. */
10+
/** An numeric literal. */
1011
abstract class NumericLiteral extends StandardLibrary::Literal {
1112
NumericLiteral() {
1213
// exclude user-defined literals as they define custom suffixes
1314
not exists(StandardLibrary::FunctionCall fc |
14-
this = fc.getArgument(0) and fc.getTarget().getName().matches("operator \"\"%")
15+
this = fc.getArgument(0) and
16+
fc.getTarget() instanceof UserDefinedLiteral
1517
) and
1618
// exclude literals derived from template instantiations
1719
not this.isFromTemplateInstantiation(_)

0 commit comments

Comments
 (0)