[umbrello] [Bug 456427] code import crash

Robert Hairgrove bugzilla_noreply at kde.org
Mon Oct 24 19:53:45 BST 2022


https://bugs.kde.org/show_bug.cgi?id=456427

Robert Hairgrove <code at roberthairgrove.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at roberthairgrove.com

--- Comment #2 from Robert Hairgrove <code at roberthairgrove.com> ---
I think the problem is that these classes depend on some KDE stuff which define
AST as a macro which formerly was probably std::auto_ptr, but in more recent
versions uses std::unique_ptr.

If the unique_ptr is wrapping a NULL pointer, then of course the &(*) etc. will
crash hbecause this is dereferencing a NULL pointer. However, `operator bool()`
is overloaded in `std::unique_ptr`, so one could also write simply:
```
if (declarator) { // etc.
```
instead of:
```
if (&(*declarator)) {
```
or
```
if (declarator.get())) {
```

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the umbrello-devel mailing list