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
/
ref-qual3.C
blob
1b21196321aed8d86a1826c9b763559f9f6395b9
1
// An explicitly defaulted function can have a ref-qualifier.
2
3
// { dg-require-effective-target c++11 }
4
5
struct A {
6
A& operator=(const A&) & = default;
7
};
8
9
template<class T>
10
struct B {
11
B& operator=(const B&) & = default;
12
};
13
14
template<class T>
15
void f()
16
{
17
B<T> b;
18
b = B<T>();
19
B<T>() = b; // { dg-error "" }
20
}
21
22
int main()
23
{
24
A a;
25
a = A();
26
A() = a; // { dg-error "" }
27
28
f<int>();
29
}