rsmith added a comment.

In https://reviews.llvm.org/D38216#922768, @lichray wrote:

> So deducing from default initialization is indeed allowed, but `extern`
>  could be interpreted as outlawed because similar to the case of non-
>  inline static data member, where the declaration doesn't give **the**
>  initialization of that variable.  @rsmith, comments?


That's almost right, but not all `extern` declarations are disallowed. (An 
`extern` declaration is still a defining declaration if it has an initializer.)



================
Comment at: lib/Sema/SemaDecl.cpp:10208
+    return DeduceTemplateSpecializationFromInitializer(
+      TSI, Entity, Kind, Init ? InitsCopy : MutableArrayRef<Expr*>());  
   }
----------------
Please put this `?:` expression into the declaration of `DeduceInits` instead 
of here. (We should build an empty list instead of a list of one null pointer 
when there is no init.)


https://reviews.llvm.org/D38216



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

Reply via email to