File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
test/rules/unusedtypedeclarations Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ private Locatable getATypeUse_i(Type type) {
132
132
result = nq and
133
133
type = nq .getQualifyingElement ( )
134
134
)
135
+ // Temporary object creation of type `type`
136
+ or
137
+ exists ( TemporaryObjectExpr toe | result = toe | type = toe .getType ( ) )
135
138
)
136
139
or
137
140
// Recursive case - used by a used type
Original file line number Diff line number Diff line change @@ -111,3 +111,14 @@ template <typename T> using Z = Y<T>; // COMPLIANT - used below
111
111
template <typename T> using AA = Y<T>; // NON_COMPLIANT - never instantiated
112
112
113
113
void test_alias_template () { Z<int > v; }
114
+
115
+ void test_temporary_object_creation () {
116
+ auto l1 = [](const auto &p1) noexcept {
117
+ class C1 { // COMPLIANT - used in temporary object construction
118
+ public:
119
+ constexpr static const char *m1 () noexcept { return " foo" ; }
120
+ };
121
+
122
+ return C1{p1};
123
+ };
124
+ }
You can’t perform that action at this time.
0 commit comments