diff options
author | Kamlesh Kumar <kamleshbhalui@gmail.com> | 2019-10-21 20:19:28 +0000 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2019-10-21 20:19:28 +0000 |
commit | a94ad13adfcb3a9448e2045130ba13afcf82a8b3 (patch) | |
tree | d37b77eabd78fced6e683868f4fc7bd028499058 /gcc/testsuite | |
parent | 6c64e7b731ceef4cd0c6053bfe50612a8a26ce82 (diff) |
PR c++/83434 - typeinfo for noexcept function lacks noexcept information
2019-10-21 Kamlesh Kumar <kamleshbhalui@gmail.com>
* rtti.c (get_tinfo_decl_dynamic): Do not call
TYPE_MAIN_VARIANT for function.
(get_typeid): Likewise.
* g++.dg/rtti/pr83534.C: New Test.
Reviewed-by: Jason Merrill <jason@redhat.com>
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277270 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/g++.dg/rtti/pr83534.C | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/rtti/pr83534.C b/gcc/testsuite/g++.dg/rtti/pr83534.C new file mode 100644 index 00000000000..af5f02ebb92 --- /dev/null +++ b/gcc/testsuite/g++.dg/rtti/pr83534.C @@ -0,0 +1,13 @@ +// { dg-options "-std=c++17" } +// { dg-do run } + +#include <typeinfo> + +void f1(); +void f2() noexcept; +int main() { + if((typeid(void()) == typeid(void ()noexcept)) + || (typeid(&f1) == typeid(&f2)) + || (typeid(f1) == typeid(f2))) + __builtin_abort(); +} |