<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[clang-tidy] Add `IgnoreValueCalls` option to bugprone-unchecked-optional-access (#167209)</title>
<updated>2025-11-11T06:14:37+00:00</updated>
<author>
<name>mitchell</name>
<email>mitchell.xu2@gmail.com</email>
</author>
<published>2025-11-11T06:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1b4f226ad951f1c163c57a37aac1c97e446b2591'/>
<id>1b4f226ad951f1c163c57a37aac1c97e446b2591</id>
<content type='text'>
Add a new option `IgnoreValueCalls` to
`bugprone-unchecked-optional-access`

Closes [#163831](https://github.com/llvm/llvm-project/issues/163831)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new option `IgnoreValueCalls` to
`bugprone-unchecked-optional-access`

Closes [#163831](https://github.com/llvm/llvm-project/issues/163831)</pre>
</div>
</content>
</entry>
<entry>
<title>[FlowSensitive] [Optional] Fix absl::in_place (#163897)</title>
<updated>2025-10-20T21:11:22+00:00</updated>
<author>
<name>Florian Mayer</name>
<email>fmayer@google.com</email>
</author>
<published>2025-10-20T21:11:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=46ab6c6fd3e6068a1f8f2935c17c09a3046180f9'/>
<id>46ab6c6fd3e6068a1f8f2935c17c09a3046180f9</id>
<content type='text'>
The mock was not accurate, absl defines in_place[_t] as an alias to
std::in_place[_t].</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The mock was not accurate, absl defines in_place[_t] as an alias to
std::in_place[_t].</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (#144313)</title>
<updated>2025-09-09T13:20:46+00:00</updated>
<author>
<name>Valentyn Yukhymenko</name>
<email>valentin.yukhymenko@gmail.com</email>
</author>
<published>2025-09-09T13:20:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cd4c82c1c3763a54e964f7507964693290fd997b'/>
<id>cd4c82c1c3763a54e964f7507964693290fd997b</id>
<content type='text'>
https://github.com/llvm/llvm-project/pull/101450 added support for
`BloombergLP::bdlb::NullableValue`.

However, `NullableValue::makeValue` and
`NullableValue::makeValueInplace` have been missed which impacts code
like this:
```cpp
  if (opt.isNull()) {
    opt.makeValue(42);
  }

  opt.value(); // triggers false positive warning from `bugprone-unchecked-optional-access`
```

My patch addresses this issue.

[Docs that I used for methods
mocks](https://bloomberg.github.io/bde-resources/doxygen/bde_api_prod/classbdlb_1_1NullableValue.html)

---------

Co-authored-by: Baranov Victor &lt;bar.victor.2002@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/pull/101450 added support for
`BloombergLP::bdlb::NullableValue`.

However, `NullableValue::makeValue` and
`NullableValue::makeValueInplace` have been missed which impacts code
like this:
```cpp
  if (opt.isNull()) {
    opt.makeValue(42);
  }

  opt.value(); // triggers false positive warning from `bugprone-unchecked-optional-access`
```

My patch addresses this issue.

[Docs that I used for methods
mocks](https://bloomberg.github.io/bde-resources/doxygen/bde_api_prod/classbdlb_1_1NullableValue.html)

---------

Co-authored-by: Baranov Victor &lt;bar.victor.2002@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] NFC: reintroduce clang/include/clang/AST/Type.h (#155050)</title>
<updated>2025-08-27T16:11:34+00:00</updated>
<author>
<name>Matheus Izvekov</name>
<email>mizvekov@gmail.com</email>
</author>
<published>2025-08-27T16:11:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=249167a8982afc3f55237baf1532c5c8ebd850b3'/>
<id>249167a8982afc3f55237baf1532c5c8ebd850b3</id>
<content type='text'>
This reintroduces `Type.h`, having earlier been renamed to `TypeBase.h`,
as a redirection to `TypeBase.h`, and redirects most users to include
the former instead.

This is a preparatory patch for being able to provide inline definitions
for `Type` methods which would otherwise cause a circular dependency
with `Decl{,CXX}.h`.

Doing these operations into their own NFC patch helps the git rename
detection logic work, preserving the history.

This patch makes clang just a little slower to build (~0.17%), just
because it makes more code indirectly include `DeclCXX.h`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reintroduces `Type.h`, having earlier been renamed to `TypeBase.h`,
as a redirection to `TypeBase.h`, and redirects most users to include
the former instead.

This is a preparatory patch for being able to provide inline definitions
for `Type` methods which would otherwise cause a circular dependency
with `Decl{,CXX}.h`.

Doing these operations into their own NFC patch helps the git rename
detection logic work, preserving the history.

This patch makes clang just a little slower to build (~0.17%), just
because it makes more code indirectly include `DeclCXX.h`.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] NFC: rename clang/include/clang/AST/Type.h to TypeBase.h (#155049)</title>
<updated>2025-08-27T16:09:48+00:00</updated>
<author>
<name>Matheus Izvekov</name>
<email>mizvekov@gmail.com</email>
</author>
<published>2025-08-27T16:09:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bcd153083634c9f4d6de45c636a58884623dbc52'/>
<id>bcd153083634c9f4d6de45c636a58884623dbc52</id>
<content type='text'>
This is a preparatory patch, to be able to provide inline definitions
for `Type` functions which depend on `Decl{,CXX}.h`. As the latter also
depends on `Type.h`, this would not be possible without some
reorganizing.

Splitting this rename into its own patch allows git to track this as a
rename, and preserve all git history, and not force any code
reformatting.

A later NFC patch will reintroduce `Type.h` as redirection to
`TypeBase.h`, rewriting most places back to directly including `Type.h`
instead of `TypeBase.h`, leaving only a handful of places where this is
necessary.

Then yet a later patch will exploit this by making more stuff inline.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a preparatory patch, to be able to provide inline definitions
for `Type` functions which depend on `Decl{,CXX}.h`. As the latter also
depends on `Type.h`, this would not be possible without some
reorganizing.

Splitting this rename into its own patch allows git to track this as a
rename, and preserve all git history, and not force any code
reformatting.

A later NFC patch will reintroduce `Type.h` as redirection to
`TypeBase.h`, rewriting most places back to directly including `Type.h`
instead of `TypeBase.h`, leaving only a handful of places where this is
necessary.

Then yet a later patch will exploit this by making more stuff inline.</pre>
</div>
</content>
</entry>
<entry>
<title>[Analysis] Remove unused includes (NFC) (#142255)</title>
<updated>2025-05-31T22:03:49+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-31T22:03:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bbb3d2177485ea4e182c369663e68f790881f557'/>
<id>bbb3d2177485ea4e182c369663e68f790881f557</id>
<content type='text'>
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][dataflow] For bugprone-unchecked-optional-access report range (#131055)</title>
<updated>2025-03-17T20:04:15+00:00</updated>
<author>
<name>Jan Voung</name>
<email>jvoung@google.com</email>
</author>
<published>2025-03-17T20:04:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6f659b0060d615435ceec53de407a8084656bc98'/>
<id>6f659b0060d615435ceec53de407a8084656bc98</id>
<content type='text'>
Report the range in diagnostics, in addition to the location
in case the range helps disambiguate a little in chained `-&gt;`
expressions.
```
b-&gt;a-&gt;f-&gt;x = 1;
^~~~~~~
```
instead of just:
```
b-&gt;a-&gt;f-&gt;x = 1;
^
```
As a followup we should probably also report the location/range
of an `-&gt;` if that operator is used. Like:
```
b-&gt;a-&gt;f-&gt;x = 1;
       ^~
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Report the range in diagnostics, in addition to the location
in case the range helps disambiguate a little in chained `-&gt;`
expressions.
```
b-&gt;a-&gt;f-&gt;x = 1;
^~~~~~~
```
instead of just:
```
b-&gt;a-&gt;f-&gt;x = 1;
^
```
As a followup we should probably also report the location/range
of an `-&gt;` if that operator is used. Like:
```
b-&gt;a-&gt;f-&gt;x = 1;
       ^~
```</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][dataflow] Add test for crash repro and clean up const accessor handling (#129930)</title>
<updated>2025-03-07T13:16:46+00:00</updated>
<author>
<name>Jan Voung</name>
<email>jvoung@google.com</email>
</author>
<published>2025-03-07T13:16:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=81168e2dc1c2069178b1acd5e302be99d7fb0e45'/>
<id>81168e2dc1c2069178b1acd5e302be99d7fb0e45</id>
<content type='text'>
Add test for https://github.com/llvm/llvm-project/issues/125589

The crash is actually incidentally fixed by
https://github.com/llvm/llvm-project/pull/128437 since it added a branch
for the reference case and would no longer fall through when the return
type is a reference to a pointer.

Clean up a bit as well:
- make the fallback for early returns more consistent (check if
  returning optional and call transfer function for that case)
- check RecordLoc == nullptr in one place
- clean up extra spaces in test
- clean up parameterization in test of `std::` vs `$ns::$`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add test for https://github.com/llvm/llvm-project/issues/125589

The crash is actually incidentally fixed by
https://github.com/llvm/llvm-project/pull/128437 since it added a branch
for the reference case and would no longer fall through when the return
type is a reference to a pointer.

Clean up a bit as well:
- make the fallback for early returns more consistent (check if
  returning optional and call transfer function for that case)
- check RecordLoc == nullptr in one place
- clean up extra spaces in test
- clean up parameterization in test of `std::` vs `$ns::$`</pre>
</div>
</content>
</entry>
<entry>
<title>[clang-tidy] [dataflow]  Cache reference accessors for `bugprone-unchecked-optional-access` (#128437)</title>
<updated>2025-02-28T18:27:20+00:00</updated>
<author>
<name>Valentyn Yukhymenko</name>
<email>valentin.yukhymenko@gmail.com</email>
</author>
<published>2025-02-28T18:27:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=818bca820ffd3e30fbd3852da0436c24ff15f8a3'/>
<id>818bca820ffd3e30fbd3852da0436c24ff15f8a3</id>
<content type='text'>
Fixes https://github.com/llvm/llvm-project/issues/126283

Extending https://github.com/llvm/llvm-project/pull/112605 to cache
const getters which return references.

Fixes false positives from const reference accessors to object
containing optional member</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://github.com/llvm/llvm-project/issues/126283

Extending https://github.com/llvm/llvm-project/pull/112605 to cache
const getters which return references.

Fixes false positives from const reference accessors to object
containing optional member</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][dataflow] Use smart pointer caching in unchecked optional accessor (#120249)</title>
<updated>2025-01-08T13:27:16+00:00</updated>
<author>
<name>Jan Voung</name>
<email>jvoung@google.com</email>
</author>
<published>2025-01-08T13:27:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=72a28a3bf0b539bcdfd8f41905675ce6a890c0ac'/>
<id>72a28a3bf0b539bcdfd8f41905675ce6a890c0ac</id>
<content type='text'>
Part 2 (and final part) following
https://github.com/llvm/llvm-project/pull/120102
Allows users to do things like:

```
if (o-&gt;x.has_value()) {
  ((*o).x).value();
}
```
where the `-&gt;` and `*` are operator overload calls.

A user could instead extract the nested optional into a local variable
once instead of doing two accessor calls back to back, but currently
they are unsure why the code is flagged.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Part 2 (and final part) following
https://github.com/llvm/llvm-project/pull/120102
Allows users to do things like:

```
if (o-&gt;x.has_value()) {
  ((*o).x).value();
}
```
where the `-&gt;` and `*` are operator overload calls.

A user could instead extract the nested optional into a local variable
once instead of doing two accessor calls back to back, but currently
they are unsure why the code is flagged.</pre>
</div>
</content>
</entry>
</feed>
