-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[analyzer] Crash on using non-type template arguments #79575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-static-analyzer Author: Balazs Benics (steakhal)
clang 18.1.0 crashes on the following code snippet, while clang-17 does not.
https://godbolt.org/z/h3sME4Gdz
This is a nullpointer dereference. constexpr char abc[] = "abc";
void use(const char *fmt);
template <const char* in>
void use_template_param() {
const char *p = in;
}
void force_instantiate() {
use_template_param<abc>();
} Stack trace:
In the AST, we have this segment for the
That dump comes from the case APValue::LValue:
(void)Context;
OS << "LValue <todo>";
return; So, some APValue must be of kind Anyways, bisections blames 5518a9d ( This is a regression, as clang-17 did not crash on the same input. Notes for myself: CPP-4927 |
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575.
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575.
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575.
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575. (cherry picked from commit ef67f63)
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575. (cherry picked from commit ef67f63)
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575. (cherry picked from commit ef67f63)
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575. (cherry picked from commit ef67f63)
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575. (cherry picked from commit ef67f63)
`OpaqueValueExpr` doesn't necessarily contain a source expression. Particularly, after llvm#78041, it is used to carry the type and the value kind of a non-type template argument of floating-point type or referring to a subobject (those are so called `StructuralValue` arguments). This fixes llvm#79575. (cherry picked from commit ef67f63)
clang 18.1.0 crashes on the following code snippet, while clang-17 does not.
https://godbolt.org/z/h3sME4Gdz
This is a nullpointer dereference.
Stack trace:
In the AST, we have this segment for the
const char *p = in;
variable declaration:That dump comes from the
TextNodeDumper.cpp
:So, some APValue must be of kind
LValue
.Anyways, bisections blames 5518a9d (
[c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (#78041)
, 2024.01.21.) commit for introducing this crash.This is a regression, as clang-17 did not crash on the same input.
Notes for myself: CPP-4927
The text was updated successfully, but these errors were encountered: