Skip to content

Commit a86f0af

Browse files
committed
delete all deprecations that are over 14 months old
1 parent ef07aaa commit a86f0af

File tree

99 files changed

+1
-3412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1
-3412
lines changed

cpp/ql/lib/semmle/code/cpp/Class.qll

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,6 @@ class Class extends UserType {
111111
result = this.getCanonicalMember(index).(TemplateVariable).getAnInstantiation()
112112
}
113113

114-
/**
115-
* DEPRECATED: Use `getCanonicalMember(int)` or `getAMember(int)` instead.
116-
* Gets the `index`th member of this class.
117-
*/
118-
deprecated Declaration getMember(int index) {
119-
member(underlyingElement(this), index, unresolveElement(result))
120-
}
121-
122-
/**
123-
* DEPRECATED: As this includes a somewhat arbitrary number of
124-
* template instantiations, it is unlikely to do what
125-
* you need.
126-
* Gets the number of members that this class has. This includes both
127-
* templates that are in this class, and instantiations of those
128-
* templates.
129-
*/
130-
deprecated int getNumMember() { result = count(this.getAMember()) }
131-
132114
/**
133115
* Gets a private member declared in this class, struct or union.
134116
* For template members, this may be either the template or an
@@ -208,23 +190,6 @@ class Class extends UserType {
208190
*/
209191
deprecated predicate hasCopyConstructor() { this.getAMemberFunction() instanceof CopyConstructor }
210192

211-
/**
212-
* Holds if this class has a copy assignment operator that is either
213-
* explicitly declared (though possibly `= delete`) or is auto-generated,
214-
* non-trivial and called from somewhere.
215-
*
216-
* DEPRECATED: There is more than one reasonable definition of what it means
217-
* to have a copy assignment operator, and we do not want to promote one
218-
* particular definition by naming it with this predicate. Having a copy
219-
* assignment operator could mean that such a member is declared or defined
220-
* in the source or that it is callable by a particular caller. For C++11,
221-
* there's also a question of whether to include members that are defaulted
222-
* or deleted.
223-
*/
224-
deprecated predicate hasCopyAssignmentOperator() {
225-
this.getAMemberFunction() instanceof CopyAssignmentOperator
226-
}
227-
228193
/**
229194
* Like accessOfBaseMember but returns multiple results if there are multiple
230195
* paths to `base` through the inheritance graph.
@@ -1070,31 +1035,6 @@ class PartialClassTemplateSpecialization extends ClassTemplateSpecialization {
10701035
override string getAPrimaryQlClass() { result = "PartialClassTemplateSpecialization" }
10711036
}
10721037

1073-
/**
1074-
* An "interface" is a class that only contains pure virtual functions (and contains
1075-
* at least one such function). For example:
1076-
* ```
1077-
* class MyInterfaceClass {
1078-
* public:
1079-
* virtual void myMethod1() = 0;
1080-
* virtual void myMethod2() = 0;
1081-
* };
1082-
* ```
1083-
*
1084-
* DEPRECATED: This class is considered to be too specific for general usage.
1085-
*/
1086-
deprecated class Interface extends Class {
1087-
Interface() {
1088-
forex(Declaration m |
1089-
m.getDeclaringType() = this.getABaseClass*() and not compgenerated(unresolveElement(m))
1090-
|
1091-
m instanceof PureVirtualFunction
1092-
)
1093-
}
1094-
1095-
override string getAPrimaryQlClass() { result = "Interface" }
1096-
}
1097-
10981038
/**
10991039
* A class/struct derivation that is virtual. For example the derivation in
11001040
* the following code is a `VirtualClassDerivation`:

cpp/ql/lib/semmle/code/cpp/Element.qll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ class ElementBase extends @element {
5555
cached
5656
string toString() { none() }
5757

58-
/** DEPRECATED: use `getAPrimaryQlClass` instead. */
59-
deprecated string getCanonicalQLClass() { result = this.getAPrimaryQlClass() }
60-
6158
/**
6259
* Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.
6360
*/
@@ -91,13 +88,6 @@ class Element extends ElementBase {
9188
*/
9289
predicate fromSource() { this.getFile().fromSource() }
9390

94-
/**
95-
* Holds if this element may be from a library.
96-
*
97-
* DEPRECATED: always true.
98-
*/
99-
deprecated predicate fromLibrary() { this.getFile().fromLibrary() }
100-
10191
/** Gets the primary location of this element. */
10292
Location getLocation() { none() }
10393

cpp/ql/lib/semmle/code/cpp/File.qll

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,7 @@ class Container extends Locatable, @container {
3434
*/
3535
string getAbsolutePath() { none() } // overridden by subclasses
3636

37-
/**
38-
* DEPRECATED: Use `getLocation` instead.
39-
* Gets a URL representing the location of this container.
40-
*
41-
* For more information see [Providing URLs](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/#providing-urls).
42-
*/
43-
deprecated string getURL() { none() } // overridden by subclasses
44-
37+
// overridden by subclasses
4538
/**
4639
* Gets the relative path of this file or folder from the root folder of the
4740
* analyzed source location. The relative path of the root folder itself is
@@ -184,43 +177,17 @@ class Folder extends Container, @folder {
184177

185178
override string getAPrimaryQlClass() { result = "Folder" }
186179

187-
/**
188-
* DEPRECATED: Use `getLocation` instead.
189-
* Gets the URL of this folder.
190-
*/
191-
deprecated override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
192-
193180
/**
194181
* DEPRECATED: use `getAbsolutePath` instead.
195182
* Gets the name of this folder.
196183
*/
197184
deprecated string getName() { folders(underlyingElement(this), result) }
198185

199-
/**
200-
* DEPRECATED: use `getAbsolutePath` instead.
201-
* Holds if this element is named `name`.
202-
*/
203-
deprecated predicate hasName(string name) { name = this.getName() }
204-
205-
/**
206-
* DEPRECATED: use `getAbsolutePath` instead.
207-
* Gets the full name of this folder.
208-
*/
209-
deprecated string getFullName() { result = this.getName() }
210-
211186
/**
212187
* DEPRECATED: use `getBaseName` instead.
213188
* Gets the last part of the folder name.
214189
*/
215190
deprecated string getShortName() { result = this.getBaseName() }
216-
217-
/**
218-
* DEPRECATED: use `getParentContainer` instead.
219-
* Gets the parent folder.
220-
*/
221-
deprecated Folder getParent() {
222-
containerparent(unresolveElement(result), underlyingElement(this))
223-
}
224191
}
225192

226193
/**
@@ -247,12 +214,6 @@ class File extends Container, @file {
247214
result.hasLocationInfo(_, 0, 0, 0, 0)
248215
}
249216

250-
/**
251-
* DEPRECATED: Use `getLocation` instead.
252-
* Gets the URL of this file.
253-
*/
254-
deprecated override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
255-
256217
/** Holds if this file was compiled as C (at any point). */
257218
predicate compiledAsC() { fileannotations(underlyingElement(this), 1, "compiled as c", "1") }
258219

@@ -308,13 +269,6 @@ class File extends Container, @file {
308269
*/
309270
override predicate fromSource() { numlines(underlyingElement(this), _, _, _) }
310271

311-
/**
312-
* Holds if this file may be from a library.
313-
*
314-
* DEPRECATED: For historical reasons this is true for any file.
315-
*/
316-
deprecated override predicate fromLibrary() { any() }
317-
318272
/** Gets the metric file. */
319273
MetricFile getMetrics() { result = this }
320274

@@ -428,25 +382,3 @@ class CppFile extends File {
428382

429383
override string getAPrimaryQlClass() { result = "CppFile" }
430384
}
431-
432-
/**
433-
* DEPRECATED: Objective-C is no longer supported.
434-
* An Objective C source file, as determined by file extension.
435-
*
436-
* For the related notion of whether a file is compiled as Objective C
437-
* code, use `File.compiledAsObjC`.
438-
*/
439-
deprecated class ObjCFile extends File {
440-
ObjCFile() { none() }
441-
}
442-
443-
/**
444-
* DEPRECATED: Objective-C is no longer supported.
445-
* An Objective C++ source file, as determined by file extension.
446-
*
447-
* For the related notion of whether a file is compiled as Objective C++
448-
* code, use `File.compiledAsObjCpp`.
449-
*/
450-
deprecated class ObjCppFile extends File {
451-
ObjCppFile() { none() }
452-
}

cpp/ql/lib/semmle/code/cpp/Location.qll

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,6 @@ class Location extends @location {
105105
}
106106
}
107107

108-
/**
109-
* DEPRECATED: Use `Location` instead.
110-
* A location of an element. Not used for expressions or statements, which
111-
* instead use LocationExpr and LocationStmt respectively.
112-
*/
113-
deprecated library class LocationDefault extends Location, @location_default { }
114-
115-
/**
116-
* DEPRECATED: Use `Location` instead.
117-
* A location of a statement.
118-
*/
119-
deprecated library class LocationStmt extends Location, @location_stmt { }
120-
121-
/**
122-
* DEPRECATED: Use `Location` instead.
123-
* A location of an expression.
124-
*/
125-
deprecated library class LocationExpr extends Location, @location_expr { }
126-
127108
/**
128109
* Gets the length of the longest line in file `f`.
129110
*/

cpp/ql/lib/semmle/code/cpp/Macro.qll

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ class Macro extends PreprocessorDirective, @ppd_define {
3030
else result = "#define " + this.getHead() + " " + this.getBody()
3131
}
3232

33-
/**
34-
* Holds if the body of the macro starts with an unmatched closing
35-
* parenthesis. For example:
36-
*
37-
* #define RPAREN() )
38-
*
39-
* DEPRECATED: This predicate has a misleading name.
40-
*/
41-
deprecated predicate isFunctionLike() { this.getBody().regexpMatch("[^(]*\\).*") }
42-
4333
/**
4434
* Gets the name of the macro. For example, `MAX` in
4535
* `#define MAX(x,y) (((x)>(y))?(x):(y))`.
@@ -261,46 +251,6 @@ class MacroInvocation extends MacroAccess {
261251
string getExpandedArgument(int i) { macro_argument_expanded(underlyingElement(this), i, result) }
262252
}
263253

264-
/**
265-
* A top-level expression generated by a macro invocation.
266-
*
267-
* DEPRECATED: Use `MacroInvocation.getExpr()` directly to get an
268-
* expression generated at the top-level of a macro invocation. Use
269-
* `MacroInvocation.getAnAffectedElement()` to get any element generated
270-
* by a macro invocation.
271-
*/
272-
deprecated class MacroInvocationExpr extends Expr {
273-
MacroInvocationExpr() { exists(MacroInvocation i | this = i.getExpr()) }
274-
275-
/**
276-
* Gets the macro invocation of which this is the top-level expression.
277-
*/
278-
MacroInvocation getInvocation() { result.getExpr() = this }
279-
280-
/** Gets the name of the invoked macro. */
281-
string getMacroName() { result = this.getInvocation().getMacroName() }
282-
}
283-
284-
/**
285-
* A top-level statement generated by a macro invocation.
286-
*
287-
* DEPRECATED: Use `MacroInvocation.getStmt()` directly to get a
288-
* statement generated at the top-level of a macro invocation. Use
289-
* `MacroInvocation.getAnAffectedElement()` to get any element generated
290-
* by a macro invocation.
291-
*/
292-
deprecated class MacroInvocationStmt extends Stmt {
293-
MacroInvocationStmt() { exists(MacroInvocation i | this = i.getStmt()) }
294-
295-
/**
296-
* Gets the macro invocation of which this is the top-level statement.
297-
*/
298-
MacroInvocation getInvocation() { result.getStmt() = this }
299-
300-
/** Gets the name of the invoked macro. */
301-
string getMacroName() { result = this.getInvocation().getMacroName() }
302-
}
303-
304254
/** Holds if `l` is the location of a macro. */
305255
predicate macroLocation(Location l) { macrolocationbind(_, l) }
306256

cpp/ql/lib/semmle/code/cpp/MemberFunction.qll

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -233,40 +233,6 @@ class ImplicitConversionFunction extends MemberFunction {
233233
Type getDestType() { none() } // overridden in subclasses
234234
}
235235

236-
/**
237-
* DEPRECATED: as of C++11 this class does not correspond perfectly with the
238-
* language definition of a converting constructor.
239-
*
240-
* A C++ constructor that also defines an implicit conversion. For example the
241-
* function `MyClass` in the following code is a `ConversionConstructor`:
242-
* ```
243-
* class MyClass {
244-
* public:
245-
* MyClass(const MyOtherClass &from) {
246-
* ...
247-
* }
248-
* };
249-
* ```
250-
*/
251-
deprecated class ConversionConstructor extends Constructor, ImplicitConversionFunction {
252-
ConversionConstructor() {
253-
strictcount(Parameter p | p = this.getAParameter() and not p.hasInitializer()) = 1 and
254-
not this.hasSpecifier("explicit")
255-
}
256-
257-
override string getAPrimaryQlClass() {
258-
not this instanceof CopyConstructor and
259-
not this instanceof MoveConstructor and
260-
result = "ConversionConstructor"
261-
}
262-
263-
/** Gets the type this `ConversionConstructor` takes as input. */
264-
override Type getSourceType() { result = this.getParameter(0).getType() }
265-
266-
/** Gets the type this `ConversionConstructor` is a constructor of. */
267-
override Type getDestType() { result = this.getDeclaringType() }
268-
}
269-
270236
private predicate hasCopySignature(MemberFunction f) {
271237
f.getParameter(0).getUnspecifiedType().(LValueReferenceType).getBaseType() = f.getDeclaringType()
272238
}

cpp/ql/lib/semmle/code/cpp/Namespace.qll

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ class Namespace extends NameQualifyingElement, @namespace {
8686
/** Holds if this namespace may be from source. */
8787
override predicate fromSource() { this.getADeclaration().fromSource() }
8888

89-
/**
90-
* Holds if this namespace is in a library.
91-
*
92-
* DEPRECATED: never holds.
93-
*/
94-
deprecated override predicate fromLibrary() { not this.fromSource() }
95-
9689
/** Gets the metric namespace. */
9790
MetricNamespace getMetrics() { result = this }
9891

@@ -233,11 +226,6 @@ class GlobalNamespace extends Namespace {
233226

234227
override Namespace getParentNamespace() { none() }
235228

236-
/**
237-
* DEPRECATED: use `getName()`.
238-
*/
239-
deprecated string getFullName() { result = this.getName() }
240-
241229
override string getFriendlyName() { result = "(global namespace)" }
242230
}
243231

0 commit comments

Comments
 (0)