summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-2.C
blob: 713b35461cf72d65dfe4b5c45b79e831012ade2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-Wstrict-aliasing=2 -O2" } */

double x;

template <typename T>
T *foo(void)
{
  return (T *)&x; /* { dg-bogus "strict-aliasing" } */
}

template double *foo<double>(void);