File tree Expand file tree Collapse file tree
cpp/ql/test/library-tests/functions/constexpr Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ constexpr int fun_constexpr ();
3+ int fun_not_constexpr ();
4+
5+ constexpr int overloaded_fun (int i) {
6+ return 5 ;
7+ }
8+
9+ int overloaded_fun (float f) {
10+ return 6 ;
11+ }
12+
13+ template <typename T>
14+ constexpr int template_fun (T t) {
15+ return overloaded_fun (t);
16+ }
17+
18+ void caller (void ) {
19+ int i;
20+ float f;
21+ template_fun (i);
22+ template_fun (f);
23+ }
24+
Original file line number Diff line number Diff line change 1+ | constexpr.cpp:2:15:2:27 | fun_constexpr | fun_constexpr() -> int | true | true |
2+ | constexpr.cpp:3:5:3:21 | fun_not_constexpr | fun_not_constexpr() -> int | false | false |
3+ | constexpr.cpp:5:15:5:28 | overloaded_fun | overloaded_fun(int) -> int | true | true |
4+ | constexpr.cpp:9:5:9:18 | overloaded_fun | overloaded_fun(float) -> int | false | false |
5+ | constexpr.cpp:14:15:14:15 | template_fun | template_fun<float>(float) -> int | true | false |
6+ | constexpr.cpp:14:15:14:15 | template_fun | template_fun<int>(int) -> int | true | true |
7+ | constexpr.cpp:14:15:14:26 | template_fun | template_fun<T>(T) -> int | true | true |
8+ | constexpr.cpp:18:6:18:11 | caller | caller() -> void | false | false |
9+ | file://:0:0:0:0 | operator= | __va_list_tag::operator=(__va_list_tag &&) -> __va_list_tag & | false | false |
10+ | file://:0:0:0:0 | operator= | __va_list_tag::operator=(const __va_list_tag &) -> __va_list_tag & | false | false |
Original file line number Diff line number Diff line change 1+ import cpp
2+
3+ from Function f
4+ select f , f .getFullSignature ( ) ,
5+ any ( boolean b | if f .isDeclaredConstexpr ( ) then b = true else b = false ) ,
6+ any ( boolean b | if f .isConstexpr ( ) then b = true else b = false )
You can’t perform that action at this time.
0 commit comments