repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wstrict-aliasing-bogus-tmpl.C
blob
d0375042e42299da2b54829ee20cc3ec9888683a
1
// PR c++/94951
2
// { dg-do compile }
3
// { dg-options "-O2 -Wall" }
4
5
struct A { int a; };
6
template <int N>
7
struct B : public A
8
{
9
static B<N> foo () { B<N> t; t.a = 4; return t; } // { dg-bogus "dereferencing type-punned pointer will break strict-aliasing rules" }
10
};
11
12
B<0> b = B<0>::foo ();