rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

LGTM, though I'd like to see this generalized to handle noreturn too.



================
Comment at: clang/lib/Sema/SemaTemplate.cpp:6997
+      QualType ResultTy;
+      if (getLangOpts().CPlusPlus17 &&
+          IsFunctionConversion(((Expr *)RefExpr.get())->getType(),
----------------
Can we remove the check for C++17 here? I would expect we want to consider the 
other kind of function conversion (from noreturn function to 
potentially-returning function) here too, and that applies in all language 
modes.

Testcase for that bug:

```
template<int (*)()> struct X {};
int f() __attribute__((noreturn));
X<&f> x;
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64874/new/

https://reviews.llvm.org/D64874



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D64874: [... Richard Smith - zygoloid via Phabricator via cfe-commits

Reply via email to