ctor6.C, [...]: New.
* g++.dg/parse/ctor6.C, g++.dg/parse/defarg11.C, g++.dg/template/friend42.C, g++.dg/template/spec30.C: New. Co-Authored-By: Kazu Hirata <kazu@codesourcery.com> From-SVN: r114585
This commit is contained in:
parent
ff8fe3e0ad
commit
dfa9dde4e0
@ -1,3 +1,9 @@
|
||||
2006-06-12 Mark Mitchell <mark@codesourcery.com>
|
||||
Kazu Hirata <kazu@codesourcery.com>
|
||||
|
||||
* g++.dg/parse/ctor6.C, g++.dg/parse/defarg11.C,
|
||||
g++.dg/template/friend42.C, g++.dg/template/spec30.C: New.
|
||||
|
||||
2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
PR c++/27933
|
||||
|
11
gcc/testsuite/g++.dg/parse/ctor6.C
Normal file
11
gcc/testsuite/g++.dg/parse/ctor6.C
Normal file
@ -0,0 +1,11 @@
|
||||
// { dg-do compile }
|
||||
|
||||
// There is no ambiguity in finding a right constructor for X b(a).
|
||||
|
||||
class X {
|
||||
public:
|
||||
X(const X&, int = 3);
|
||||
};
|
||||
|
||||
extern X a;
|
||||
X b(a);
|
9
gcc/testsuite/g++.dg/parse/defarg11.C
Normal file
9
gcc/testsuite/g++.dg/parse/defarg11.C
Normal file
@ -0,0 +1,9 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-pedantic" }
|
||||
|
||||
class foo {
|
||||
public:
|
||||
void operator& (int = 1); // { dg-error "default argument" }
|
||||
void operator++ (int = 2); // { dg-error "default argument" }
|
||||
void operator-- (int = 3); // { dg-error "default argument" }
|
||||
};
|
8
gcc/testsuite/g++.dg/template/friend42.C
Normal file
8
gcc/testsuite/g++.dg/template/friend42.C
Normal file
@ -0,0 +1,8 @@
|
||||
// { dg-do compile }
|
||||
|
||||
template <class T> void foo (int);
|
||||
|
||||
template <class T>
|
||||
class Q {
|
||||
friend void foo<T> (int = 3); // { dg-error "default argument" }
|
||||
};
|
15
gcc/testsuite/g++.dg/template/spec30.C
Normal file
15
gcc/testsuite/g++.dg/template/spec30.C
Normal file
@ -0,0 +1,15 @@
|
||||
// { dg-do compile }
|
||||
|
||||
template<int N>
|
||||
inline int
|
||||
foo (int a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
template<>
|
||||
inline int
|
||||
foo<0> (int a = 123) // { dg-error "default argument" }
|
||||
{
|
||||
return a + 1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user