@@ -282,9 +282,12 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
282282 * definition, if possible.)
283283 */
284284 override Location getLocation ( ) {
285- if exists ( this .getDefinition ( ) )
286- then result = this .getDefinitionLocation ( )
287- else result = this .getADeclarationLocation ( )
285+ if this instanceof BuiltInFunction
286+ then result instanceof UnknownLocation // a dummy location for the built-in function
287+ else
288+ if exists ( this .getDefinition ( ) )
289+ then result = this .getDefinitionLocation ( )
290+ else result = this .getADeclarationLocation ( )
288291 }
289292
290293 /** Gets a child declaration of this function. */
@@ -896,17 +899,9 @@ class FunctionTemplateSpecialization extends Function {
896899 * A GCC built-in function. For example: `__builtin___memcpy_chk`.
897900 */
898901class BuiltInFunction extends Function {
899- BuiltInFunction ( ) { functions ( underlyingElement ( this ) , _, 6 ) }
900-
901- /** Gets a dummy location for the built-in function. */
902- override Location getLocation ( ) {
903- suppressUnusedThis ( this ) and
904- result instanceof UnknownLocation
905- }
902+ BuiltInFunction ( ) { builtin_functions ( underlyingElement ( this ) ) }
906903}
907904
908- private predicate suppressUnusedThis ( Function f ) { any ( ) }
909-
910905/**
911906 * A C++ user-defined literal [N4140 13.5.8].
912907 */
0 commit comments