<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in template-param-objects.cpp</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>11c3a21f - [analyzer] Workaround crash on encountering Class non-type template parameters</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/clang/test/Analysis/template-param-objects.cpp#11c3a21f</link>
        <description>[analyzer] Workaround crash on encountering Class non-type template parametersThe Clang Static Analyzer will crash on this code:```lang=C++struct Box {  int value;};template &lt;Box V&gt; int get() {  return V.value;}template int get&lt;Box{-1}&gt;();```https://godbolt.org/z/5Yb1sMMMbThe problem is that we don&apos;t account for encountering `TemplateParamObjectDecl`swithin the `DeclRefExpr` handler in the `ExprEngine`.IMO we should create a new memregion for representing such templateparam objects, to model their language semantics.Such as: - it should have global static storage - for two identical values, their addresses should be identical as wellhttp://eel.is/c%2B%2Bdraft/temp.param#8I was thinking of introducing a `TemplateParamObjectRegion` under `DeclRegion`for this purpose. It could have `TemplateParamObjectDecl` as a field.The `TemplateParamObjectDecl::getValue()` returns `APValue`, which mightrepresent multiple levels of structures, unions and other goodies -making the transformation from `APValue` to `SVal` a bit complicated.That being said, for now, I think having `Unknowns` for such cases isdefinitely an improvement to crashing, hence I&apos;m proposing this patch.Reviewed By: xazax.hunDifferential Revision: https://reviews.llvm.org/D135763(cherry picked from commit b062ee7dc4515b0a42157717105839627d5542bb)

            List of files:
            /llvm-project-15.0.7/clang/test/Analysis/template-param-objects.cpp</description>
        <pubDate>Thu, 13 Oct 2022 06:41:31 +0000</pubDate>
        <dc:creator>Balazs Benics &lt;benicsbalazs@gmail.com&gt;</dc:creator>
    </item>
</channel>
</rss>
