[frama-clang] Cannot parse C++14 variable template
Steps to reproduce the issue
Please find attached two example sources that demonstrate the issue: fails.cpp works.cpp
> cat fails.cpp
template <class _Tp>
struct in_place_type_t {};
template <class _Tp>
in_place_type_t<_Tp> in_place_type{};
int main() {
return 0;
}
> clang++-11 -E -o fails.ii fails.cpp
> frama-c -deps -cpp-extra-args=-std=c++14 fails.ii
Expected output
[kernel] Parsing fails.ii (external front-end)
Now output intermediate result
<...>
[from] Computing for function main
[from] Done for function main
[from] ====== DEPENDENCIES COMPUTED ======
These dependencies hold at termination for the executions that terminate:
[from] Function main:
\result FROM \nothing
[from] ====== END OF DEPENDENCIES ======
Actual output
[kernel] Parsing fails.ii (external front-end)
fails.cpp:5:22: Unsupported Type (uninstantiated template specialization):in_place_type_t<_Tp>
Aborting
[kernel] User Error: Failed to parse C++ file. See Clang messages for more information
[kernel] User Error: stopping on file "fails.ii" that has errors.
[kernel] Frama-C aborted: invalid user input.
Minimal working diff
It works if we avoid the unused in_place_type
variable:
> diff -u fails.cpp works.cpp
--- fails.cpp 2021-06-08 22:57:23.374859568 +0000
+++ works.cpp 2021-06-08 23:04:33.305251313 +0000
@@ -1,8 +1,8 @@
template <class _Tp>
struct in_place_type_t {};
-template <class _Tp>
-in_place_type_t<_Tp> in_place_type{};
+//template <class _Tp>
+//in_place_type_t<_Tp> in_place_type{};
int main() {
return 0;
Contextual information
- Frama-C: framac/frama-c:22.0 Docker Image ID e45780e160f1
- Plug-in used: frama-clang-0.0.10 built from official source drop
- Compiler: Debian clang version 11.1.0
- Target: x86_64-pc-linux-gnu
Additional information
Variable templates are a C++14 language feature: https://isocpp.org/wiki/faq/cpp14-language#variable-templates