repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
c++: robustify testcase [PR109752]
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
var-templ2.C
blob
c734f413145281fedd9dd043bae2499716cebaea
1
// { dg-do compile { target c++14 } }
2
3
// Template variables and static member variables of template classes are
4
// often confused.
5
6
template<typename T>
7
struct S1
8
{
9
static int n;
10
static int arr[];
11
};
12
13
template<typename T>
14
constexpr int var = sizeof (T);
15
16
template<typename T>
17
int S1<T>::n = sizeof (T);
18
19
template<typename T>
20
int S1<T>::arr[sizeof (T)];
21
22
template<>
23
int S1<int>::n = 8;
24
25
template<>
26
int S1<int>::arr[8];
27
28
int main ()
29
{
30
S1<int> v1;
31
var<S1<int>>;
32
return 0;
33
}