> Yeah, it's as you suspect: 'x' has no linkage, so its address can't be used
> as a non-type template parameter. f<nullptr> here works, and exhibits the
> bug.

Thanks, I reported pr16059 with it.

> The following should also work, but is rejected, because we incorrectly
> think that foo<S>::x has no linkage (with or without the inline keyword):
>
> template <typename T>
> struct foo {
>   template <T *P> static void f() {
>   }
>   static void *g() {
>     f<&x>();
>   }
>   static T x;
> };
> template<typename T> T foo<T>::x;


and pr16060 for the case with static x.

Cheers,
Rafael
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to