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:
Mark Mitchell 2006-06-12 22:26:00 +00:00 committed by Kazu Hirata
parent ff8fe3e0ad
commit dfa9dde4e0
5 changed files with 49 additions and 0 deletions

View File

@ -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

View 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);

View 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" }
};

View 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" }
};

View 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;
}