@@ -156,7 +156,7 @@ class NamespaceDeclarationEntry extends Locatable, @namespace_decl {
156
156
* A C++ `using` directive or `using` declaration.
157
157
*/
158
158
class UsingEntry extends Locatable , @using {
159
- override Location getLocation ( ) { usings ( underlyingElement ( this ) , _, result ) }
159
+ override Location getLocation ( ) { usings ( underlyingElement ( this ) , _, result , _ ) }
160
160
}
161
161
162
162
/**
@@ -166,15 +166,13 @@ class UsingEntry extends Locatable, @using {
166
166
* ```
167
167
*/
168
168
class UsingDeclarationEntry extends UsingEntry {
169
- UsingDeclarationEntry ( ) {
170
- not exists ( Namespace n | usings ( underlyingElement ( this ) , unresolveElement ( n ) , _) )
171
- }
169
+ UsingDeclarationEntry ( ) { usings ( underlyingElement ( this ) , _, _, 1 ) }
172
170
173
171
/**
174
172
* Gets the declaration that is referenced by this using declaration. For
175
173
* example, `std::string` in `using std::string`.
176
174
*/
177
- Declaration getDeclaration ( ) { usings ( underlyingElement ( this ) , unresolveElement ( result ) , _) }
175
+ Declaration getDeclaration ( ) { usings ( underlyingElement ( this ) , unresolveElement ( result ) , _, _ ) }
178
176
179
177
override string toString ( ) { result = "using " + this .getDeclaration ( ) .getDescription ( ) }
180
178
}
@@ -186,19 +184,36 @@ class UsingDeclarationEntry extends UsingEntry {
186
184
* ```
187
185
*/
188
186
class UsingDirectiveEntry extends UsingEntry {
189
- UsingDirectiveEntry ( ) {
190
- exists ( Namespace n | usings ( underlyingElement ( this ) , unresolveElement ( n ) , _) )
191
- }
187
+ UsingDirectiveEntry ( ) { usings ( underlyingElement ( this ) , _, _, 2 ) }
192
188
193
189
/**
194
190
* Gets the namespace that is referenced by this using directive. For
195
191
* example, `std` in `using namespace std`.
196
192
*/
197
- Namespace getNamespace ( ) { usings ( underlyingElement ( this ) , unresolveElement ( result ) , _) }
193
+ Namespace getNamespace ( ) { usings ( underlyingElement ( this ) , unresolveElement ( result ) , _, _ ) }
198
194
199
195
override string toString ( ) { result = "using namespace " + this .getNamespace ( ) .getFriendlyName ( ) }
200
196
}
201
197
198
+ /**
199
+ * A C++ `using enum` declaration. For example:
200
+ * ```
201
+ * enum class Foo { a, b };
202
+ * using enum Foo;
203
+ * ```
204
+ */
205
+ class UsingEnumDeclarationEntry extends UsingEntry {
206
+ UsingEnumDeclarationEntry ( ) { usings ( underlyingElement ( this ) , _, _, 3 ) }
207
+
208
+ /**
209
+ * Gets the enumeration that is referenced by this using directive. For
210
+ * example, `Foo` in `using enum Foo`.
211
+ */
212
+ Enum getEnum ( ) { usings ( underlyingElement ( this ) , unresolveElement ( result ) , _, _) }
213
+
214
+ override string toString ( ) { result = "using enum " + this .getEnum ( ) .getQualifiedName ( ) }
215
+ }
216
+
202
217
/**
203
218
* Holds if `g` is an instance of `GlobalNamespace`. This predicate
204
219
* is used suppress a warning in `GlobalNamespace.getADeclaration()`
0 commit comments