llvm-project/clang/test/Modules/try-func-body.cppm
Chuanqi Xu 68427bc8d8
[C++20] [Modules] Support generating in-class defined function with try-catch body (#129212)
See the example:

```
export module func;
class C {
public:
    void member() try {

    } catch (...) {

    }
};
```

We woudln't generate the definition for `C::member` but we should. Since
the function is non-inline in modules.

This turns out to be an oversight in parser to me. Since the try-catch
body is relatively rare, so maybe we just forgot it.
2025-03-05 10:32:19 +08:00

14 lines
262 B
C++

// RUN: %clang_cc1 -std=c++20 %s -fexceptions -fcxx-exceptions -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
export module func;
class C {
public:
void member() try {
} catch (...) {
}
};
// CHECK: define {{.*}}@_ZNW4func1C6memberEv