[PATCH] D122518: [scudo] Use template specialization on Quarantine to avoid zero-length array

Roland McGrath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 18:43:09 PDT 2022


mcgrathr reopened this revision.
mcgrathr added inline comments.
This revision is now accepted and ready to land.


================
Comment at: compiler-rt/lib/scudo/standalone/secondary.h:372
+  };
+  template <> class QuarantineBlocks<0> {
+  public:
----------------
Explicit specializations must appear at namespace/top-level scope, not inside the class.
You can still specialize the private class, you just have to do it with the scoped name rather than from inside the scope.
GCC does not accept this.  Its code quotes the spec thusly:
```
 /* [temp.expl.spec]                                                           
                                                                                
     An explicit specialization shall be declared in the namespace of           
     which the template is a member, or, for member templates, in the           
     namespace of which the enclosing class or enclosing class                  
     template is a member.  An explicit specialization of a member              
     function, member class or static data member of a class template           
     shall be declared in the namespace of which the class template             
     is a member.  */                                                           

```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122518



More information about the llvm-commits mailing list