https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124354
Bug ID: 124354
Summary: [reflection] is_function returns false for a
substituted template function
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: alexey.saldyrkine at gmail dot com
Target Milestone: ---
Created attachment 63822
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63822&action=edit
Preprocessed source
meta::is_function returns false for a substituted template function. It should
return true.
```
#include <meta>
namespace meta = std::meta;
template<typename T>
int f(int a){
return a;
}
constexpr auto refl = meta::substitute(^^f,{^^int});
static_assert(refl == ^^f<int>);
static_assert(meta::is_function(^^f<int>));
static_assert(meta::is_function(refl)); // static_assert fails here
int main()
{}
```
<source>:12:32: error: static assertion failed
12 | static_assert(meta::is_function(refl)); // static_assert fails here
| ~~~~~~~~~~~~~~~~~^~~~~~
Compiler returned: 1
## GCC Version, system, and options:
```
Using built-in specs.
COLLECT_GCC=/opt/compiler-explorer/gcc-snapshot/bin/g++
Target: x86_64-linux-gnu
Configured with: ../gcc-trunk-20260303/configure
--prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu
--enable-languages=c,c++,fortran,ada,objc,obj-c++,go,d,rust,m2,cobol,algol68
--enable-ld=yes --enable-gold=yes --enable-libstdcxx-time=yes
--enable-linker-build-id --enable-lto --enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build-gcc-549e7ae158cd68135831054a1e1c1dec31df53b3-binutils-2.44
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.1 20260303 (experimental)
(Compiler-Explorer-Build-gcc-549e7ae158cd68135831054a1e1c1dec31df53b3-binutils-2.44)
```
## Command line:
```
-g -o output.s -masm=intel -fno-verbose-asm -S -fdiagnostics-color=always
-std=c++26 -freflection -Wall -Wextra -v example.cpp
```