blob: 65b1222a5c063120ce52b719e6761e363e475232 [file] [log] [blame]
// { dg-do run }
// { dg-options "-fsanitize=alignment -Wall -Wno-unused-variable -std=c++11" }
typedef const long int L;
int a = 1;
L b = 2;
int
main (void)
{
int *p = &a;
L *l = &b;
int &r = *p;
auto &r2 = *p;
L &lr = *l;
// Try an rvalue reference.
auto &&r3 = *p;
// Don't evaluate the reference initializer twice.
int i = 1;
int *q = &i;
int &qr = ++*q;
if (i != 2)
__builtin_abort ();
}