================
@@ -3695,6 +3695,22 @@ static void handleInitPriorityAttr(Sema &S, Decl *D, 
const ParsedAttr &AL) {
   D->addAttr(::new (S.Context) InitPriorityAttr(S.Context, AL, prioritynum));
 }
 
+static void handleFlattenDepthAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+  Expr *E = AL.getArgAsExpr(0);
+  uint32_t depthHint;
+  if (!S.checkUInt32Argument(AL, E, depthHint)) {
----------------
erichkeane wrote:

This doesn't seem to handle dependent arguments, which, IMO, we probably want 
to support.  Consider:

```
template<typename T, unsigned I> struct S {

[[flatten_depth(I)]]
void func1(){/*...*/}

[[flatten_depth(T::value)]]
void func2(){/*...*/}

};

struct HasVal { static constexpr int value = 3; };

void foo() {
   S<HasVal, 2> s;
s.func1();
s.func2();
}
```


I would expect that to work without issue.

https://github.com/llvm/llvm-project/pull/165777
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to