-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C++ front-end: support explicit type conversion with braced-init-list
Now follows the grammar described in the C++ standard: Explicit type conversions are postfix expressions. This required adding rules for C++ cast expressions, which in turn simplifies type checking for we no longer treat them as function calls with template arguments.
- Loading branch information
1 parent
f529e30
commit 83b210e
Showing
9 changed files
with
336 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <cassert> | ||
|
||
int main(int argc, char * argv[]) | ||
{ | ||
struct S { | ||
S() : x(42) | ||
{ | ||
} | ||
|
||
int x; | ||
}; | ||
S s = S{}; | ||
|
||
__CPROVER_assert(s.x == 42, ""); | ||
assert(s.x == 42); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
main.cpp | ||
|
||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
^warning: ignoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
struct __invoke_memfun_ref {}; | ||
constexpr bool __call_is_nt(__invoke_memfun_ref) | ||
{ | ||
return false; | ||
} | ||
|
||
template<typename _Result> | ||
struct __call_is_nothrow | ||
{ | ||
constexpr static bool is_nt = | ||
__call_is_nt(typename _Result::__invoke_type{}); | ||
}; | ||
|
||
int main(int argc, char * argv[]) | ||
{ | ||
struct S { | ||
S() : x(42) | ||
{ | ||
} | ||
|
||
int x; | ||
}; | ||
S s = S{}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
main.cpp | ||
-std=c++11 | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- | ||
^warning: ignoring | ||
^CONVERSION ERROR$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.