Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1270700
| From | Markus Blatt <markus@dr-blatt.de> |
|---|---|
| Newsgroups | linux.debian.bugs.dist |
| Subject | Bug#1120951: g++-15: Compilation error about class not being a non-union class type for valid C++ code |
| Date | 2025-11-18 19:50 +0100 |
| Message-ID | <LSyW5-dWH6-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Package: g++-15
Version: 15.2.0-8
Severity: important
Tags: upstream
Dear Maintainer,
the recently uploaded version of g++ caused compilation errors in some packages
during rebuils, e.g. opm-simulators [1].
This simple C++ program fails to compile:
#include <set>
template <class S>
class A
{
typedef S VertexSet;
public:
typename VertexSet::size_type size();
private:
VertexSet vertices_;
};
template <class S>
inline typename A<S>::VertexSet::size_type A<S>::size()
{
return vertices_.size();
}
int main()
{
A<std::set<int>> a;
return a.size();
}
with the error:
<source>:16:55: error: 'class A<S>::VertexSet' resolves to 'A<S>::VertexSet',
which is not a non-union class type [-Wtemplate-body]
16 | inline typename A<S>::VertexSet::size_type A<S>::size()
| ^
Compiler returned: 1
See also [2].
The expected outcome would be that the program compiles without any errors.
One can work around this problem by defining a typename size_type for
VertexSet::size_type and using that instead. A similar fix has been applied to
dune-istl in [3]
Best,
Markus
[1] https://buildd.debian.org/status/fetch.php?pkg=opm-
simulators&arch=loong64&ver=2025.10%2Bds-1%2Bb1&stamp=1763168796&raw=0
[2] https://godbolt.org/z/xodooafea
[3] https://salsa.debian.org/science-team/dune-
istl/-/commit/51fedd3623c511f79ef5c2c6321fb62b9c08b5cf
-- System Information:
Debian Release: 12.12
APT prefers oldstable-updates
APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-40-amd64 (SMP w/64 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Back to linux.debian.bugs.dist | Previous | Next — Next in thread | Find similar | Unroll thread
Bug#1120951: g++-15: Compilation error about class not being a non-union class type for valid C++ code Markus Blatt <markus@dr-blatt.de> - 2025-11-18 19:50 +0100 Bug#1120951: g++-15: Compilation error about class not being a non-union class type for valid C++ code Christoph GrĂ¼ninger <foss@grueninger.de> - 2025-11-18 22:00 +0100
csiph-web