We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9e3684 commit 4d89b43Copy full SHA for 4d89b43
1 file changed
cpp/common/test/rules/unsignedintegerliteralsnotappropriatelysuffixed/test.cpp
@@ -543,4 +543,20 @@ void test_macro() {
543
COMPLIANT_VAL; // COMPLIANT
544
NON_COMPLIANT_VAL; // NON_COMPLIANT[FALSE_NEGATIVE] - cannot determine suffix
545
// in macro expansions
546
-}
+}
547
+
548
+constexpr unsigned long long operator""_km(unsigned long long value) {
549
+ return value;
550
551
552
+void test_user_defined_literal_exclusion() {
553
+ 0x80000000_km; // COMPLIANT - user-defined literal argument should be excluded
554
555
556
+template <typename T> unsigned long long instantiated_literal_exclusion() {
557
+ return T{}; // COMPLIANT - template instantiation should be excluded
558
559
560
+void test_instantiated_literal_exclusion() {
561
+ instantiated_literal_exclusion<int>();
562
0 commit comments