Version: (using Devel) Compiler: gcc 4.3.3 OS: Linux Installed from: Compiled sources "Implelent function" does not preserve exceptions specification from function declaration Steps to reproduce: 1. decalre a method with some throw (...) in header 2. switch to cpp 3. invoke "implement function" 4. function definition without exception specification will appears
*** Bug 277009 has been marked as a duplicate of this bug. ***
It still happen with clang version. When a function is marked `noexcept`, or `throw()`, I expect the generated implemented function to have these specification also. Right now, It's not generated and the generated function does not compile/match the header.
libclang doesn't seem to expose any way to query the expression for a computed noexcept and similarly the types inside a throw(..)
(In reply to Amish Naidu from comment #3) > libclang doesn't seem to expose any way to query the expression for a > computed noexcept and similarly the types inside a throw(..) Is this still true? It's been almost two years. Perhaps the function clang_getCursorExceptionSpecificationType does the job now.
I have submitted a merge request to fix this at least in the case where the specification is noexcept (no expression provided) or throw() (no types provided).
Git commit ad50f05907ab9d25e80dfa2e5ee203b92dd7aa58 by Aleix Pol Gonzalez, on behalf of Guillermo Frontera. Committed on 14/10/2020 at 01:18. Pushed by apol into branch 'master'. Add exception specification to function signatures When using the IDE to generate function definitions, some elements from the function signature are omitted. One of those are exception specifications. This commit adds exception specification to function signatures if the specification is `noexcept` (no expression provided) or `throw()` (no types provided). More complex specifications cannot be added for now as libclang does not provide the required information. M +8 -0 plugins/clang/tests/test_codecompletion.cpp M +11 -0 plugins/clang/util/clangutils.cpp https://invent.kde.org/kdevelop/kdevelop/commit/ad50f05907ab9d25e80dfa2e5ee203b92dd7aa58