add comment regarding potential UB in AnyTest::testCastToReference()

This commit is contained in:
Günter Obiltschnig 2021-06-16 08:07:39 +02:00
parent 5948cc8be4
commit 35a53d8f2d

View File

@ -132,6 +132,8 @@ void AnyTest::testCastToReference()
int& ra = AnyCast<int &>(a);
int const& ra_c = AnyCast<int const &>(a);
// NOTE: The following two AnyCasts will trigger the
// undefined behavior sanitizer.
int volatile& ra_v = AnyCast<int volatile &>(a);
int const volatile& ra_cv = AnyCast<int const volatile&>(a);