[PATCH] D50418: [Sema] Support for P0961R1: Relaxing the structured bindings customization point finding rules

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 9 12:24:53 PDT 2018


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

LGTM with a small bugfix.



================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:1122
+    for (Decl *D : MemberGet) {
+      if (FunctionTemplateDecl *FTD = dyn_cast<FunctionTemplateDecl>(D)) {
+        TemplateParameterList *TPL = FTD->getTemplateParameters();
----------------
You should use `D->getUnderlyingDecl()` rather than just `D` here, otherwise you'll reject this:

```
struct A {
  template<int> void get();
};
struct B : A {
  using A::get;
};
```

... because `D` will be a `UsingShadowDecl` not a `FunctionTemplateDecl`. (Please also add a corresponding testcase.)


https://reviews.llvm.org/D50418





More information about the cfe-commits mailing list