================
@@ -2052,6 +2052,19 @@ class Declarator {
Expr *PackIndexingExpr;
+public:
+ /// A function contract specifier whose predicate must be parsed after its
+ /// enclosing class is complete.
+ struct LateParsedContractSpecifier {
+ bool IsPost;
+ IdentifierInfo *ResultName = nullptr;
+ SourceLocation ResultNameLoc;
+ std::unique_ptr<CachedTokens> PredicateTokens;
+ };
+
+private:
+ SmallVector<LateParsedContractSpecifier, 2> LateParsedContractSpecifiers;
----------------
yronglin wrote:
IIUC, we should cleanup this when clearing Declarator states, the following
code should be accepted, but clang rejected it with: `error: virtual specifier
'override' must appear before contract specifiers`:
```cpp
struct Base {
virtual void g();
};
struct Derived : Base {
void f() pre(true),
g() __attribute__((unused)) override;
};
```
https://github.com/llvm/llvm-project/pull/221139
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits