diff --git a/cpp/ql/src/semmle/code/cpp/Element.qll b/cpp/ql/src/semmle/code/cpp/Element.qll index 77a27d49725..8076f62583a 100644 --- a/cpp/ql/src/semmle/code/cpp/Element.qll +++ b/cpp/ql/src/semmle/code/cpp/Element.qll @@ -197,7 +197,8 @@ class Element extends ElementBase { initialisers(underlyingElement(this), unresolveElement(result), _, _) or exprconv(unresolveElement(result), underlyingElement(this)) or param_decl_bind(underlyingElement(this), _, unresolveElement(result)) or - using_container(unresolveElement(result), underlyingElement(this)) + using_container(unresolveElement(result), underlyingElement(this)) or + static_asserts(unresolveElement(this), _, _, _, underlyingElement(result)) } /** Gets the closest `Element` enclosing this one. */ @@ -278,12 +279,12 @@ class StaticAssert extends Locatable, @static_assert { /** * Gets the expression which this static assertion ensures is true. */ - Expr getCondition() { static_asserts(underlyingElement(this), unresolveElement(result), _, _) } + Expr getCondition() { static_asserts(underlyingElement(this), unresolveElement(result), _, _, _) } /** * Gets the message which will be reported by the compiler if this static assertion fails. */ - string getMessage() { static_asserts(underlyingElement(this), _, result, _) } + string getMessage() { static_asserts(underlyingElement(this), _, result, _, _) } - override Location getLocation() { static_asserts(underlyingElement(this), _, _, result) } + override Location getLocation() { static_asserts(underlyingElement(this), _, _, result, _) } } diff --git a/cpp/ql/src/semmlecode.cpp.dbscheme b/cpp/ql/src/semmlecode.cpp.dbscheme index 025827d85c3..098850d25c4 100644 --- a/cpp/ql/src/semmlecode.cpp.dbscheme +++ b/cpp/ql/src/semmlecode.cpp.dbscheme @@ -508,7 +508,8 @@ static_asserts( unique int id: @static_assert, int condition : @expr ref, string message : string ref, - int location: @location_default ref + int location: @location_default ref, + int enclosing : @element ref ); // each function has an ordered list of parameters