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
PR c++/85765 - SFINAE and non-type default template arg.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
sfinae28.C
blob
1eeba64bc1dc326314cd27fb94d4940a4556ed64
1
// PR c++/50324
2
// { dg-do compile { target c++11 } }
3
4
struct complete { };
5
struct incomplete;
6
7
template<class T> auto f(T *) -> decltype(T{}) *;
8
template<class T> char f(T);
9
10
int main()
11
{
12
complete *p = 0;
13
static_assert(sizeof(f(p)) == sizeof(void*), "");
14
incomplete *q = 0;
15
static_assert(sizeof(f(q)) == 1u, "");
16
}