On 20 February 2016 at 23:35, H.J. Lu wrote:
> Can a compiler tell if a copy constructor or destructor is trivial
> from the class declaration without function body?
Yes, the mere presence of the declaration suffices to render it
non-trivial (unless explicitly declared "= default" like I did with
layout, and has a trivial
default constructor, but it has a non-trivial copy constructor and
non-trivial destructor.
Matthijs van Duin
On 20 February 2016 at 18:55, H.J. Lu wrote:
> struct dummy0
> {
> };
>
> struct dummy
> {
> dummy0 d[20];
>
> dummy0 * foo (int i);
> };
>
> dummy0 *
> dummy::foo (int i)
> {
> return &d[i];
> }
>
> dummy0 *
> bar (dummy d, int i)
> {
> return d.foo (i);
> }
1. This has undefined behavio
equires no
reference to the original object.
Matthijs van Duin
On 19 February 2016 at 16:27, H.J. Lu wrote:
> We want to include static member functions and exclude non-static member
> functions.
There's no reason to disallow non-static member functions in general; they
have no impact on being trivially copyable or not, only the presence of a
non-trivial cop
On 11 February 2016 at 16:31, H.J. Lu wrote:
> struct A {
> static void foo (void) ();
> static int xxx;
> };
What about it? It's an empty struct. (And it declares a function and
a variable in the namespace of A, which however do not have any
relevant impact here.)
Matthijs van Duin
tion of
C/C++ arrays, which cannot be directly passed by value even if the
syntax may suggest they can (hence the rule being discussed is not
applicable to them).
Matthijs van Duin
ere
syntax sugar, C/C++ do not support passing an actual array by value.)
Matthijs van Duin
and
destruction is the appropriate criterion here rather than this obscure
constraint on layout.
Matthijs van Duin
nt here, e.g. struct U is
unusually large considering its lack of data members, due to the need
for padding between its base classes, but this doesn't change the fact
it can be copied using no operation (and g++ indeed does).
Matthijs van Duin
-layout, it is trivially-copyable and I see
no reason to allocate a register to pass it.
Matthijs van Duin
On 4 October 2015 at 10:50, mads_bn wrote:
> Can somebody try if e.g. backtrace_symbols () will show where the offending
> code was called from?
Included a backtrace test, pushed to github.
./test(_Z9backtracev+0xb)[0x10f28]
./test(_Z17backtrace_handleri+0x5)[0x10f4a] < signal handler
./
On 4 October 2015 at 10:05, Andrew Haley wrote:
> Do you have GCC copyright assignment
No, but I hereby license it under the http://www.wtfpl.net/ (or, in
any legal system which acknowledges such an act, place it in public
domain)
> will you turn this into a patch which can be applied?
I've alr
te applies) and I had to plow through the
innards of libgcc and libsupc++ to figure out how things *actually*
work. Argh.
Anyhow, it only took four years, but you can now throw
NullPointerExceptions on ARM. Enjoy. ;-)
Matthijs van Duin
I've managed to expand Paul's outline into working code. It's still
incomplete but I can report success throwing an exception in a signal
handler and catching it outside it.
I didn't rebuild glibc but just linked some extra code to my executable.
The I grabbed from glibc, the rest are system head
15 matches
Mail list logo