Skip to content

Conversation

@ian-semmle
Copy link
Contributor

No description provided.

@ian-semmle ian-semmle added the C++ label Feb 28, 2019
@ian-semmle ian-semmle requested a review from a team as a code owner February 28, 2019 16:21
@ian-semmle ian-semmle added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Feb 28, 2019
jbj
jbj previously approved these changes Mar 1, 2019
Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR LGTM. I guess there's no concept of "declared constexpr but not actually constexpr" for variables. I tried to construct such a case, but I couldn't make one that would compile.

* There is a new `Namespace.isInline()` predicate, which holds if the namespace was declared as `inline namespace`.
* The `Expr.isConstant()` predicate now also holds for _address constant expressions_, which are addresses that will be constant after the program has been linked. These address constants do not have a result for `Expr.getValue()`.
* There are new `Function.isDeclaredConstexpr()` and `Function.isConstexpr()` predicates. They can be used to tell whether a function was declared as `constexpr`, and whether it actually is `constexpr`.
* There is a new `Variable.isConstexpr()` predicates. It can be used to tell whether a variable is `constexpr`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/predicates/predicate/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ta, fixed.

@nickrolfe nickrolfe merged commit e6ddf7f into github:master Mar 1, 2019
@ian-semmle ian-semmle deleted the constexpr branch March 1, 2019 16:18
@jbj jbj mentioned this pull request Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants