<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/AST/ByteCode/functions.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][bytecode] Typecheck called function pointers more thorougly (#159757)</title>
<updated>2025-09-19T12:24:48+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-09-19T12:24:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=68c9ddb93022f46f49d8b1a6063065d3a15aba0f'/>
<id>68c9ddb93022f46f49d8b1a6063065d3a15aba0f</id>
<content type='text'>
Fix two older FIXME items from the `functions.cpp` test.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix two older FIXME items from the `functions.cpp` test.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][bytecode] Implement Pointer::getType() for function pointers (#154788)</title>
<updated>2025-08-21T18:01:22+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-08-21T18:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8b091961b134661a3bbc95646a3a9b2344d684f8'/>
<id>8b091961b134661a3bbc95646a3a9b2344d684f8</id>
<content type='text'>
Fixes #152920</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #152920</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][bytecode] Prefer ParmVarDecls as function parameters (#153952)</title>
<updated>2025-08-16T15:22:14+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-08-16T15:22:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=373206d5e0591896477f988e4194f59eee7981e1'/>
<id>373206d5e0591896477f988e4194f59eee7981e1</id>
<content type='text'>
We might create a local temporary variable for a ParmVarDecl, in which
case a DeclRefExpr for that ParmVarDecl should _still_ result in us
choosing the parameter, not that local.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We might create a local temporary variable for a ParmVarDecl, in which
case a DeclRefExpr for that ParmVarDecl should _still_ result in us
choosing the parameter, not that local.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][bytecode] Use visitExpr() in interpretCall (#152857)</title>
<updated>2025-08-09T16:30:26+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-08-09T16:30:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=870aa979c4854d23e368845acd459d1e4ff7d2e0'/>
<id>870aa979c4854d23e368845acd459d1e4ff7d2e0</id>
<content type='text'>
This is the correct function to use and it will create a variable scope.

Fixes #152822</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the correct function to use and it will create a variable scope.

Fixes #152822</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][ExprConst] Consider integer pointers of value 0 nullptr (#150164)</title>
<updated>2025-08-06T14:49:00+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-08-06T14:49:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8704ca0fb8fb3c659a4e98e9362cd56d453dcb4b'/>
<id>8704ca0fb8fb3c659a4e98e9362cd56d453dcb4b</id>
<content type='text'>
When casting a 0 to a pointer type, the IsNullPtr flag was always set to
false, leading to weird results like a pointer with value 0 that isn't a
null pointer.

This caused

```c++
struct B { const int *p;};
template&lt;B&gt; void f() {}
template void f&lt;B{nullptr}&gt;();
template void f&lt;B{fold(reinterpret_cast&lt;int*&gt;(0))}&gt;();
```

to be valid code, since nullptr and (int*)0 aren't equal. This seems
weird and GCC doesn't behave like this.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When casting a 0 to a pointer type, the IsNullPtr flag was always set to
false, leading to weird results like a pointer with value 0 that isn't a
null pointer.

This caused

```c++
struct B { const int *p;};
template&lt;B&gt; void f() {}
template void f&lt;B{nullptr}&gt;();
template void f&lt;B{fold(reinterpret_cast&lt;int*&gt;(0))}&gt;();
```

to be valid code, since nullptr and (int*)0 aren't equal. This seems
weird and GCC doesn't behave like this.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Forbid reinterpret_cast of function pointers in constexpr. (#150557)</title>
<updated>2025-07-31T01:15:17+00:00</updated>
<author>
<name>Eli Friedman</name>
<email>efriedma@quicinc.com</email>
</author>
<published>2025-07-31T01:15:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0bbe1b30faf57b5007d7be6af64ae423b4992de4'/>
<id>0bbe1b30faf57b5007d7be6af64ae423b4992de4</id>
<content type='text'>
This has been explicitly forbidden since C++11, but somehow the edge
case of converting a function pointer to void* using a cast like
`(void*)f` wasn't handled.

Fixes #150340 .</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This has been explicitly forbidden since C++11, but somehow the edge
case of converting a function pointer to void* using a cast like
`(void*)f` wasn't handled.

Fixes #150340 .</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] include attribute scope in diagnostics (#144619)</title>
<updated>2025-07-08T08:36:52+00:00</updated>
<author>
<name>Oleksandr T.</name>
<email>oleksandr.tarasiuk@outlook.com</email>
</author>
<published>2025-07-08T08:36:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2e8e254d18f51b6ca898bf0b1e4d12109b5b16c7'/>
<id>2e8e254d18f51b6ca898bf0b1e4d12109b5b16c7</id>
<content type='text'>
This patch updates diagnostics to print fully qualified attribute names,
including scope when present.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch updates diagnostics to print fully qualified attribute names,
including scope when present.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][bytecode] Ignore function calls with depth &gt; 0... (#129887)</title>
<updated>2025-03-05T15:21:03+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-03-05T15:21:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bdbc434498016ee22c06983c8b2725c169326b66'/>
<id>bdbc434498016ee22c06983c8b2725c169326b66</id>
<content type='text'>
... when checking for a potential constant expression. This is also what
the current interpreter does.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... when checking for a potential constant expression. This is also what
the current interpreter does.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][bytecode] Only emit literal_comparison for string literals (#129691)</title>
<updated>2025-03-04T13:07:53+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-03-04T13:07:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=53d433e702736f9edfee57ec2c1628c729336866'/>
<id>53d433e702736f9edfee57ec2c1628c729336866</id>
<content type='text'>
This is what the current interpreter does as well.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is what the current interpreter does as well.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][ExprConst] Add diagnostics for invalid binary arithmetic (#118475)</title>
<updated>2025-01-09T10:42:35+00:00</updated>
<author>
<name>Timm Baeder</name>
<email>tbaeder@redhat.com</email>
</author>
<published>2025-01-09T10:42:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fd6baa477fa13a4b893aeeba7fce92eb6a1f4962'/>
<id>fd6baa477fa13a4b893aeeba7fce92eb6a1f4962</id>
<content type='text'>
... between unrelated declarations or literals.

Leaving this small (I haven't run the whole test suite locally) to get
some feedback on the wording and implementation first.

The output of the sample in
https://github.com/llvm/llvm-project/issues/117409 is now:
```console
./array.cpp:57:6: warning: expression result unused [-Wunused-value]
   57 |   am - aj.af();
      |   ~~ ^ ~~~~~~~
./array.cpp:70:8: error: call to consteval function 'L::L&lt;bx&gt;' is not a constant expression
   70 |   q(0, [] {
      |        ^
./array.cpp:57:6: note: arithmetic on addresses of literals has unspecified value
   57 |   am - aj.af();
      |      ^
./array.cpp:62:5: note: in call to 'al(&amp;""[0], {&amp;""[0]})'
   62 |     al(bp.af(), k);
      |     ^~~~~~~~~~~~~~
./array.cpp:70:8: note: in call to 'L&lt;bx&gt;({})'
   70 |   q(0, [] {
      |        ^~~~
   71 |     struct bx {
      |     ~~~~~~~~~~~
   72 |       constexpr operator ab&lt;g&lt;l&lt;decltype(""[0])&gt;::e&gt;::e&gt;() { return t(""); }
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73 |     };
      |     ~~
   74 |     return bx();
      |     ~~~~~~~~~~~~
   75 |   }());
      |   ~~~
```

The output for 
```c++
int a, b;
constexpr int n = &amp;b - &amp;a
```

is now:
```console
./array.cpp:80:15: error: constexpr variable 'n' must be initialized by a constant expression
   80 | constexpr int n = &amp;b - &amp;a;
      |               ^   ~~~~~~~
./array.cpp:80:22: note: arithmetic involving '&amp;b' and '&amp;a' has unspecified value
   80 | constexpr int n = &amp;b - &amp;a;
      |                      ^
1 error generated.

```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... between unrelated declarations or literals.

Leaving this small (I haven't run the whole test suite locally) to get
some feedback on the wording and implementation first.

The output of the sample in
https://github.com/llvm/llvm-project/issues/117409 is now:
```console
./array.cpp:57:6: warning: expression result unused [-Wunused-value]
   57 |   am - aj.af();
      |   ~~ ^ ~~~~~~~
./array.cpp:70:8: error: call to consteval function 'L::L&lt;bx&gt;' is not a constant expression
   70 |   q(0, [] {
      |        ^
./array.cpp:57:6: note: arithmetic on addresses of literals has unspecified value
   57 |   am - aj.af();
      |      ^
./array.cpp:62:5: note: in call to 'al(&amp;""[0], {&amp;""[0]})'
   62 |     al(bp.af(), k);
      |     ^~~~~~~~~~~~~~
./array.cpp:70:8: note: in call to 'L&lt;bx&gt;({})'
   70 |   q(0, [] {
      |        ^~~~
   71 |     struct bx {
      |     ~~~~~~~~~~~
   72 |       constexpr operator ab&lt;g&lt;l&lt;decltype(""[0])&gt;::e&gt;::e&gt;() { return t(""); }
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73 |     };
      |     ~~
   74 |     return bx();
      |     ~~~~~~~~~~~~
   75 |   }());
      |   ~~~
```

The output for 
```c++
int a, b;
constexpr int n = &amp;b - &amp;a
```

is now:
```console
./array.cpp:80:15: error: constexpr variable 'n' must be initialized by a constant expression
   80 | constexpr int n = &amp;b - &amp;a;
      |               ^   ~~~~~~~
./array.cpp:80:22: note: arithmetic involving '&amp;b' and '&amp;a' has unspecified value
   80 | constexpr int n = &amp;b - &amp;a;
      |                      ^
1 error generated.

```</pre>
</div>
</content>
</entry>
</feed>
