I am looking for an example of a cohomology class $[\alpha]$ in even dimension of a smooth projective complex variety $X$ i.e. $[\alpha]\in H^{2i}(X, \mathbb{Q})$ where $i>0$, such that you cannot kill $[\alpha]$ by restricting to any Zariski open. This class can't be a Hodge class $(i,i)$ type, otherwise it should go to zero.
Edit: I just found out about this, which basically gives a lot of examples including $K3$ surfaces.