[PATCH] D68923: Don't warn about missing declarations for partial template specializations

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 08:40:24 PST 2020


aaron.ballman added a comment.

In D68923#1857046 <https://reviews.llvm.org/D68923#1857046>, @aaronpuchert wrote:

> In D68923#1853527 <https://reviews.llvm.org/D68923#1853527>, @aaronpuchert wrote:
>
> > In D68923#1853303 <https://reviews.llvm.org/D68923#1853303>, @aaron.ballman wrote:
> >
> > > I think it's a simple enough fix that it may be worth it, but it isn't fixing a regression in behavior so it's not critical.
> >
> >
> > Exactly, it would just be a bug fix.
>
>
> Actually it is a regression, but one that we already had in Clang 9. Try <https://godbolt.org/z/dD5hMc> this code:
>
>   template <typename T>
>   constexpr bool X = true;
>  
>   template <typename T>
>   constexpr bool X<T*> = false;
>
>
> Clang 9 emits the following false positive warning, which Clang 8 doesn't emit:
>
>   <source>:5:16: warning: no previous extern declaration for non-static variable 'X<T *>' [-Wmissing-variable-declarations]
>   constexpr bool X<T*> = false;
>                  ^
>   <source>:5:11: note: declare 'static' if the variable is not intended to be used outside of this translation unit
>   constexpr bool X<T*> = false;
>             ^
>


Feel free to suggest to Hans to add this to the 10.0 release.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68923





More information about the cfe-commits mailing list