-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-cpp-14] Support variable template specialization
- Loading branch information
1 parent
68a0dc9
commit 9a5f374
Showing
6 changed files
with
41 additions
and
0 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
12 changes: 12 additions & 0 deletions
12
regression/esbmc-cpp14/template/var-template-specialization-fail/main.cpp
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,12 @@ | ||
#include <assert.h> | ||
|
||
template <typename> | ||
int a; | ||
|
||
int main() | ||
{ | ||
a<int> = 2; | ||
a<double> = 3; | ||
assert(a<int> == 3); | ||
assert(a<double> == 4); | ||
} |
5 changes: 5 additions & 0 deletions
5
regression/esbmc-cpp14/template/var-template-specialization-fail/test.desc
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,5 @@ | ||
CORE | ||
main.cpp | ||
--cppstd 14 | ||
|
||
^VERIFICATION FAILED$ |
14 changes: 14 additions & 0 deletions
14
regression/esbmc-cpp14/template/var-template-specialization/main.cpp
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,14 @@ | ||
#include <assert.h> | ||
|
||
template <typename> | ||
int a; | ||
|
||
int main() | ||
{ | ||
a<int> = 2; | ||
a<double> = 42; | ||
assert(a<int> == 2); | ||
assert(a<int> != 42); | ||
assert(a<double> == 42); | ||
assert(a<double> != 2); | ||
} |
5 changes: 5 additions & 0 deletions
5
regression/esbmc-cpp14/template/var-template-specialization/test.desc
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,5 @@ | ||
CORE | ||
main.cpp | ||
--cppstd 14 | ||
|
||
^VERIFICATION SUCCESSFUL$ |
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