Commit 876200a8 by Mark Mitchell Committed by Mark Mitchell

spec4.C: Remove stray semicolon.

	* g++.dg/eh/spec4.C: Remove stray semicolon.
	* g++.dg/expr/pmf-1.C: Change error message.
	* g++.dg/ext/asm1.C: Remove stray semicolon.
	* g++.dg/ext/typename1.C: Add missing typenames.
	* g++.dg/inherit/template-as-base.C: Change error message.
	* g++.dg/lookup/scoped1.C: Likewise.
	* g++.dg/lookup/scoped2.C: Likewise.
	* g++.dg/lookup/using2.C: Likewise.
	* g++.dg/other/component1.C: Remove stray semicolon.
	* g++.dg/other/do1.C: Change error message.
	* g++.dg/other/error2.C: Likewise.
	* g++.dg/other/init1.C: Likewise.
	* g++.dg/other/packed1.C: Remove stray semicolon.
	* g++.dg/other/ptrmem2.C: Change error message.
	* g++.dg/parse/parameter-declaration-1.C: Remove line number
	marker.
	* g++.dg/special/initp1.C: Remove invalid attribute usage.
	* g++.dg/template/access3.C: Add typename keyword.
	* g++.dg/template/access5.C: Remove stray semicolon.
	* g++.dg/template/access6.C: Likewise.
	* g++.dg/template/complit1.C: Likewise.
	* g++.dg/template/crash1.C: Change error message.
	* g++.dg/template/inherit2.C: Remove stray semicolon.
	* g++.dg/template/instantiate2.C: Likewise.
	* g++.dg/template/instantiate3.C: Change error message.
	* g++.dg/template/qual1.C: Remove stray semicolon.
	* g++.dg/template/qualttp18.C: Change error message.
	* g++.dg/template/ref1.C: Remove stray semicolon.
	* g++.dg/template/sizeof1.C (A::value): Declare it.
	* g++.dg/template/spec4.C: Change error message.
	* g++.dg/template/static1.C: Likewise.
	* g++.dg/template/type1.C: Likewise.
	* g++.dg/template/typename3.C: Likewise.
	* g++.old-deja/g++.benjamin/13478.C: Change error message.
	* g++.old-deja/g++.benjamin/15799.C: Remove stray semicolon.
	* g++.old-deja/g++.benjamin/bool01.C: Likewise.
	* g++.old-deja/g++.benjamin/bool02.C: Likewise.
	* g++.old-deja/g++.benjamin/p13417.C: Now fails due to use of
	named return value extension.
	* g++.old-deja/g++.benjamin/tem06.C: Remove stray semicolon.
	* g++.old-deja/g++.benjmain/warn01.C: Likewise.
	* g++.old-deja/g++.bob/extern_C.C: Likewise.
	* g++.old-deja/g++.bob/inherit2.C: Likewise.
	* g++.old-deja/g++.brendan/complex1.C: Likewise.
	* g++.old-deja/g++.brendan/copy5.C: Likewise.
	* g++.old-deja/g++.brendan/crash13.C: Likewise.
	* g++.old-deja/g++.brendan/crash15.C: Likewise.
	* g++.old-deja/g++.brendan/crash18.C: Change error message.
	* g++.old-deja/g++.brendan/crash37.C: Remove stray semicolon.
	* g++.old-deja/g++.brendan/crash38.C: Likewise.
	* g++.old-deja/g++.brendan/crash50.C: Likewise.
	* g++.old-deja/g++.brendan/crash56.C: Likewise.
	* g++.old-deja/g++.brendan/crash6.C: Use explicit specialization
	syntax.
	* g++.old-deja/g++.brendan/crash66.C: Remove stray semicolon.
	* g++.old-deja/g++.brendan/crash8.C: Change error message.
	* g++.old-deja/g++.brendan/ctors1.C: Remove stray semicolon.
	* g++.old-deja/g++.brendan/ctors2.C: Likewise.
	* g++.old-deja/g++.brendan/shadow1.C: Likewise.
	* g++.old-deja/g++.brendan/template11.C: Likewise.
	* g++.old-deja/g++.brendan/template26.C: Likewise.
	* g++.old-deja/g++.brendan/template27.C: Use explicit
	specialization syntax.
	* g++.old-deja/g++.brendan/template30.C: Likewise.
	* g++.old-deja/g++.brendan/template5.C: Remove stray semicolon.
	* g++.old-deja/g++.brendan/visibility3.C: Account for use of
	non-dependent names.
	* g++.old-deja/g++.brendan/warnings4.C: Remove stray semicolon.
	* g++.old-deja/g++.brendan/warnings7.C: Likewise.
	* g++.old-deja/g++.bugs/900121_02.C: Likewise.
	* g++.old-deja/g++.eh/catchptr1.C: Likewise.
	* g++.old-deja/g++.ext/addrfunc4.C: Likewise.
	* g++.old-deja/g++.ext/namedret1.C: Now fails due to use of
	named return value extension.
	* g++.old-deja/g++.ext/namedret2.C: Likewise.
	* g++.old-deja/g++.ext/namedret3.C: Likewise.
	* g++.old-deja/g++.ext/return1.C: Likewise.
	* g++.old-deja/g++.ext/typename1.C: Add missing typename keywords.
	* g++.old-deja/g++.jason/access17.C: Issue more error messages.
	* g++.old-deja/g++.jason/access8.C: Likewise.
	* g++.old-deja/g++.jason/bool.C: Remove stray semicolon.
	* g++.old-deja/g++.jason/destruct.C: Remove incorrect
	pseudo-destructor names.
	* g++.old-deja/g++.jason/dtor3.C: Remove stray semicolon.
	* g++.old-deja/g++.jason/dtor5.C: Remove incorrect
	pseudo-destructor names.
	* g++.old-deja/g++.jason/opeq3.C: Remove stray semicolon.
	* g++.old-deja/g++.jason/overload19.C: Likewise.
	* g++.old-deja/g++.jason/overload32.C: Likewise.
	* g++.old-deja/g++.jason/parse11.C: Issue error messages about
	stray semicolons.
	* g++.old-deja/g++.jason/pmem2.C: Remove stray semicolon.
	* g++.old-deja/g++.jason/return.C: Likewise.
	* g++.old-deja/g++.jason/return2.C: Likewise.
	* g++.old-deja/g++.jason/shadow1.C: Likewise.
	* g++.old-deja/g++.jason/special.C: Use explicit specialization
	syntax.
	* g++.old-deja/g++.jason/template10.C: Account for use of
	non-dependent names.
	* g++.old-deja/g++.jason/template11.C: Use explicit specialization
	syntax.
	* g++.old-deja/g++.jason/template37.C: Likewise.
	* g++.old-deja/g++.law/access4.C: Change error messages.
	* g++.old-deja/g++.law/arm13.C:  Remove incorrect
	pseudo-destructor names.
	* g++.old-deja/g++.law/code-gen5.C: Remove stray semicolon.
	* g++.old-deja/g++.law/ctors9.C: Likewise.
	* g++.old-deja/g++.law/cvt22.C: Likewise.
	* g++.old-deja/g++.law/dtors5.C: Likewise.
	* g++.old-deja/g++.law/global-init1.C: Likewise.
	* g++.old-deja/g++.law/missed-error3.C: Likewise.
	* g++.old-deja/g++.law/operators28.C: Likewise.
	* g++.old-deja/g++.law/visibility28.C: Likewise.
	* g++.old-deja/g++.martin/eval1.C: Likewise.
	* g++.old-deja/g++.martin/pmf2.C: Remove qualifier in constructor
	name.
	* g++.old-deja/g++.mike/hog1.C: Remove stray semicolon.
	* g++.old-deja/g++.mike/net34.C: Likewise.
	* g++.old-deja/g++.mike/net36.C: Likewise.
	* g++.old-deja/g++.mike/ns2.C: Likewise.
	* g++.old-deja/g++.mike/p12306.C: Likewise.
	* g++.old-deja/g++.mike/p646.C: Adjust for removal of named return
	value extension.
	* g++.old-deja/g++.mike/p700.C: Likewise.
	* g++.old-deja/g++.mike/p701.C: Remove stray semicolon.
	* g++.old-deja/g++.mike/p710.C: Likewise.
	* g++.old-deja/g++.mike/p784.C: Adjust for removal of named return
	value extension.
	* g++.old-deja/g++.mike/pmf7.C: Remove stray semicolon.
	* g++.old-deja/g++.mike/pmf9.C: Likewise.
	* g++.old-deja/g++.ns/crash2.C: Likewise.
	* g++.old-deja/g++.ns/crash3.C: Likewise.
	* g++.old-deja/g++.ns/invalid1.C: Likewise.
	* g++.old-deja/g++.ns/ns17.C: Likewise.
	* g++.old-deja/g++.ns/template16.C: Likewise.
	* g++.old-deja/g++.ns/template5.C: Remove invalid use of template
	keyword.
	* g++.old-deja/g++.ns/template6.C: Remove stray semicolon.
	* g++.old-deja/g++.ns/using9.C: Remove stray semicolon.
	* g++.old-deja/g++.oliva/nameret1.C: Now fails due to use of
	named return value extension.
	* g++.old-deja/g++.oliva/nameret2.C: Likewise.
	* g++.old-deja/g++.other/access4.C: Issue additional error
	messages.
	* g++.old-deja/g++.other/array6.C: Remove stray semicolon.
	* g++.old-deja/g++.other/crash1.C: Isue additional error messages.
	* g++.old-deja/g++.other/crash11.C: Add missing class-key.
	* g++.old-deja/g++.other/crash25.C: Change error message.
	* g++.old-deja/g++.other/crash4.C: Change error message.
	* g++.old-deja/g++.other/debug7.C: Remove stray semicolon.
	* g++.old-deja/g++.other/decl5.C: Issue more error messages.
	* g++.old-deja/g++.other/defarg7.C: Remove circular dependency
	checks.
	* g++.old-deja/g++.other/defarg8.C: Likewise.
	* g++.old-deja/g++.other/dtor1.C: Remove stray semicolon.
	* g++.old-deja/g++.other/dtor10.C: Likewise.
	* g++.old-deja/g++.other/incomplete.C: Likewise.
	* g++.old-deja/g++.other/linkage7.C: Likewise.
	* g++.old-deja/g++.other/lookup19.C: Now fails due to corrected
	lookup algorithm.
	* g++.old-deja/g++.other/mangle2.C: Likewise.
	* g++.old-deja/g++.other/refinit2.C: Likewise.
	* g++.old-deja/g++.other/sizeof2.C: Change error messages.
	* g++.old-deja/g++.other/std1.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/crash28.C: Likewise.
	* g++.old-deja/g++.pt/crash29.C: Use explicit specialization
	syntax.
	* g++.old-deja/g++.pt/crash32.C: Change error message.
	* g++.old-deja/g++.pt/crash43.C: Adjust error messages.
	* g++.old-deja/g++.pt/crash58.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/crash65.C: Tweak to acount for change in
	error message position.
	* g++.old-deja/g++.pt/defarg5.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/defarg8.C: Change error message.
	* g++.old-deja/g++.pt/eichin01.C: Use explicit specialization
	syntax.
	* g++.old-deja/g++.pt/eichin01a.C: Define static data members.
	* g++.old-deja/g++.pt/eichin01b.C: Likewise.
	* g++.old-deja/g++.pt/enum7.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/explicit12.C: Remove invalid use of template
	keyword.
	* g++.old-deja/g++.pt/explicit31.C: Likewise.
	* g++.old-deja/g++.pt/explicit33.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/explicit35.C: Remove invalid use of template
	keyword.
	* g++.old-deja/g++.pt/explicit71.C: Change error message.
	* g++.old-deja/g++.pt/explicit80.C: Use explicit specialization
	syntax.
	* g++.old-deja/g++.pt/friend28.C: Account for use of
	non-dependent names.
	* g++.old-deja/g++.pt/friend29.C: Likewise.
	* g++.old-deja/g++.pt/friend46.C: Adjust for correct name lookup
	rules.
	* g++.old-deja/g++.pt/friend48.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/instantiate1.C: Use correct class-key.
	* g++.old-deja/g++.pt/instantiate11.C: Adjust for correct name
	lookup rules.
	* g++.old-deja/g++.pt/instantiate8.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/instantiate9.C: Insert missing typename
	keyword.
	* g++.old-deja/g++.pt/memclass20.C: Likewise.
	* g++.old-deja/g++.pt/memclass5.C: Likewise.
	* g++.old-deja/g++.pt/memclass7.C: Remove invalid use of template
	keyword.
	* g++.old-deja/g++.pt/memtemp75.C: Likewise.
	* g++.old-deja/g++.pt/memtemp81.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/memtemp87.C: Add missing access specifier.
	* g++.old-deja/g++.pt/overload13.C: Correct error messages.
	* g++.old-deja/g++.pt/parms2.C: Add missing typename keyword.
	* g++.old-deja/g++.pt/ptrmem1.C: Remove invalid use of template
	keyword.
	* g++.old-deja/g++.pt/spec10.C: Likewise.
	* g++.old-deja/g++.pt/spec28.C: Reorder declarations.
	* g++.old-deja/g++.pt/t10.C: Add explicit specialization syntax.
	* g++.old-deja/g++.pt/t32.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/t35a.C: Add explicit specialization syntax.
	* g++.old-deja/g++.pt/ttp24.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/ttp62.C: Likewise.
	* g++.old-deja/g++.pt/ttp64.C: Likewise.
	* g++.old-deja/g++.pt/typename11.C: Add missing typename keyword.
	* g++.old-deja/g++.pt/typename15.C: Likewise.
	* g++.old-deja/g++.pt/typename22.C: Likewise.
	* g++.old-deja/g++.pt/typename6.C: Change error messages.
	* g++.old-deja/g++.pt/using1.C: Remove stray semicolon.
	* g++.old-deja/g++.pt/virtual2.C: Likewise.
	* g++.old-deja/g++.robertl/eb118.C: Add explicit specialization
	syntax.
	* g++.old-deja/g++.robertl/eb27.C: Now fails due to use of named
	return value extension.
	* g++.old-deja/g++.robertl/eb43.C: Remove stray semicolon.
	* g++.old-deja/g++.robertl/eb79.C: Correct for new name lookup rules.
	* g++.old-deja/g++.robertl/eb82.C: Remove stray semicolons.
	* g++.old-deja/g++.robertl/eb86.C: Add missing forward declaration.

From-SVN: r60559
parent 671aa708
2002-12-27 Mark Mitchell <mark@codesourcery.com>
* g++.dg/eh/spec4.C: Remove stray semicolon.
* g++.dg/expr/pmf-1.C: Change error message.
* g++.dg/ext/asm1.C: Remove stray semicolon.
* g++.dg/ext/typename1.C: Add missing typenames.
* g++.dg/inherit/template-as-base.C: Change error message.
* g++.dg/lookup/scoped1.C: Likewise.
* g++.dg/lookup/scoped2.C: Likewise.
* g++.dg/lookup/using2.C: Likewise.
* g++.dg/other/component1.C: Remove stray semicolon.
* g++.dg/other/do1.C: Change error message.
* g++.dg/other/error2.C: Likewise.
* g++.dg/other/init1.C: Likewise.
* g++.dg/other/packed1.C: Remove stray semicolon.
* g++.dg/other/ptrmem2.C: Change error message.
* g++.dg/parse/parameter-declaration-1.C: Remove line number
marker.
* g++.dg/special/initp1.C: Remove invalid attribute usage.
* g++.dg/template/access3.C: Add typename keyword.
* g++.dg/template/access5.C: Remove stray semicolon.
* g++.dg/template/access6.C: Likewise.
* g++.dg/template/complit1.C: Likewise.
* g++.dg/template/crash1.C: Change error message.
* g++.dg/template/inherit2.C: Remove stray semicolon.
* g++.dg/template/instantiate2.C: Likewise.
* g++.dg/template/instantiate3.C: Change error message.
* g++.dg/template/qual1.C: Remove stray semicolon.
* g++.dg/template/qualttp18.C: Change error message.
* g++.dg/template/ref1.C: Remove stray semicolon.
* g++.dg/template/sizeof1.C (A::value): Declare it.
* g++.dg/template/spec4.C: Change error message.
* g++.dg/template/static1.C: Likewise.
* g++.dg/template/type1.C: Likewise.
* g++.dg/template/typename3.C: Likewise.
* g++.old-deja/g++.benjamin/13478.C: Change error message.
* g++.old-deja/g++.benjamin/15799.C: Remove stray semicolon.
* g++.old-deja/g++.benjamin/bool01.C: Likewise.
* g++.old-deja/g++.benjamin/bool02.C: Likewise.
* g++.old-deja/g++.benjamin/p13417.C: Now fails due to use of
named return value extension.
* g++.old-deja/g++.benjamin/tem06.C: Remove stray semicolon.
* g++.old-deja/g++.benjmain/warn01.C: Likewise.
* g++.old-deja/g++.bob/extern_C.C: Likewise.
* g++.old-deja/g++.bob/inherit2.C: Likewise.
* g++.old-deja/g++.brendan/complex1.C: Likewise.
* g++.old-deja/g++.brendan/copy5.C: Likewise.
* g++.old-deja/g++.brendan/crash13.C: Likewise.
* g++.old-deja/g++.brendan/crash15.C: Likewise.
* g++.old-deja/g++.brendan/crash18.C: Change error message.
* g++.old-deja/g++.brendan/crash37.C: Remove stray semicolon.
* g++.old-deja/g++.brendan/crash38.C: Likewise.
* g++.old-deja/g++.brendan/crash50.C: Likewise.
* g++.old-deja/g++.brendan/crash56.C: Likewise.
* g++.old-deja/g++.brendan/crash6.C: Use explicit specialization
syntax.
* g++.old-deja/g++.brendan/crash66.C: Remove stray semicolon.
* g++.old-deja/g++.brendan/crash8.C: Change error message.
* g++.old-deja/g++.brendan/ctors1.C: Remove stray semicolon.
* g++.old-deja/g++.brendan/ctors2.C: Likewise.
* g++.old-deja/g++.brendan/shadow1.C: Likewise.
* g++.old-deja/g++.brendan/template11.C: Likewise.
* g++.old-deja/g++.brendan/template26.C: Likewise.
* g++.old-deja/g++.brendan/template27.C: Use explicit
specialization syntax.
* g++.old-deja/g++.brendan/template30.C: Likewise.
* g++.old-deja/g++.brendan/template5.C: Remove stray semicolon.
* g++.old-deja/g++.brendan/visibility3.C: Account for use of
non-dependent names.
* g++.old-deja/g++.brendan/warnings4.C: Remove stray semicolon.
* g++.old-deja/g++.brendan/warnings7.C: Likewise.
* g++.old-deja/g++.bugs/900121_02.C: Likewise.
* g++.old-deja/g++.eh/catchptr1.C: Likewise.
* g++.old-deja/g++.ext/addrfunc4.C: Likewise.
* g++.old-deja/g++.ext/namedret1.C: Now fails due to use of
named return value extension.
* g++.old-deja/g++.ext/namedret2.C: Likewise.
* g++.old-deja/g++.ext/namedret3.C: Likewise.
* g++.old-deja/g++.ext/return1.C: Likewise.
* g++.old-deja/g++.ext/typename1.C: Add missing typename keywords.
* g++.old-deja/g++.jason/access17.C: Issue more error messages.
* g++.old-deja/g++.jason/access8.C: Likewise.
* g++.old-deja/g++.jason/bool.C: Remove stray semicolon.
* g++.old-deja/g++.jason/destruct.C: Remove incorrect
pseudo-destructor names.
* g++.old-deja/g++.jason/dtor3.C: Remove stray semicolon.
* g++.old-deja/g++.jason/dtor5.C: Remove incorrect
pseudo-destructor names.
* g++.old-deja/g++.jason/opeq3.C: Remove stray semicolon.
* g++.old-deja/g++.jason/overload19.C: Likewise.
* g++.old-deja/g++.jason/overload32.C: Likewise.
* g++.old-deja/g++.jason/parse11.C: Issue error messages about
stray semicolons.
* g++.old-deja/g++.jason/pmem2.C: Remove stray semicolon.
* g++.old-deja/g++.jason/return.C: Likewise.
* g++.old-deja/g++.jason/return2.C: Likewise.
* g++.old-deja/g++.jason/shadow1.C: Likewise.
* g++.old-deja/g++.jason/special.C: Use explicit specialization
syntax.
* g++.old-deja/g++.jason/template10.C: Account for use of
non-dependent names.
* g++.old-deja/g++.jason/template11.C: Use explicit specialization
syntax.
* g++.old-deja/g++.jason/template37.C: Likewise.
* g++.old-deja/g++.law/access4.C: Change error messages.
* g++.old-deja/g++.law/arm13.C: Remove incorrect
pseudo-destructor names.
* g++.old-deja/g++.law/code-gen5.C: Remove stray semicolon.
* g++.old-deja/g++.law/ctors9.C: Likewise.
* g++.old-deja/g++.law/cvt22.C: Likewise.
* g++.old-deja/g++.law/dtors5.C: Likewise.
* g++.old-deja/g++.law/global-init1.C: Likewise.
* g++.old-deja/g++.law/missed-error3.C: Likewise.
* g++.old-deja/g++.law/operators28.C: Likewise.
* g++.old-deja/g++.law/visibility28.C: Likewise.
* g++.old-deja/g++.martin/eval1.C: Likewise.
* g++.old-deja/g++.martin/pmf2.C: Remove qualifier in constructor
name.
* g++.old-deja/g++.mike/hog1.C: Remove stray semicolon.
* g++.old-deja/g++.mike/net34.C: Likewise.
* g++.old-deja/g++.mike/net36.C: Likewise.
* g++.old-deja/g++.mike/ns2.C: Likewise.
* g++.old-deja/g++.mike/p12306.C: Likewise.
* g++.old-deja/g++.mike/p646.C: Adjust for removal of named return
value extension.
* g++.old-deja/g++.mike/p700.C: Likewise.
* g++.old-deja/g++.mike/p701.C: Remove stray semicolon.
* g++.old-deja/g++.mike/p710.C: Likewise.
* g++.old-deja/g++.mike/p784.C: Adjust for removal of named return
value extension.
* g++.old-deja/g++.mike/pmf7.C: Remove stray semicolon.
* g++.old-deja/g++.mike/pmf9.C: Likewise.
* g++.old-deja/g++.ns/crash2.C: Likewise.
* g++.old-deja/g++.ns/crash3.C: Likewise.
* g++.old-deja/g++.ns/invalid1.C: Likewise.
* g++.old-deja/g++.ns/ns17.C: Likewise.
* g++.old-deja/g++.ns/template16.C: Likewise.
* g++.old-deja/g++.ns/template5.C: Remove invalid use of template
keyword.
* g++.old-deja/g++.ns/template6.C: Remove stray semicolon.
* g++.old-deja/g++.ns/using9.C: Remove stray semicolon.
* g++.old-deja/g++.oliva/nameret1.C: Now fails due to use of
named return value extension.
* g++.old-deja/g++.oliva/nameret2.C: Likewise.
* g++.old-deja/g++.other/access4.C: Issue additional error
messages.
* g++.old-deja/g++.other/array6.C: Remove stray semicolon.
* g++.old-deja/g++.other/crash1.C: Isue additional error messages.
* g++.old-deja/g++.other/crash11.C: Add missing class-key.
* g++.old-deja/g++.other/crash25.C: Change error message.
* g++.old-deja/g++.other/crash4.C: Change error message.
* g++.old-deja/g++.other/debug7.C: Remove stray semicolon.
* g++.old-deja/g++.other/decl5.C: Issue more error messages.
* g++.old-deja/g++.other/defarg7.C: Remove circular dependency
checks.
* g++.old-deja/g++.other/defarg8.C: Likewise.
* g++.old-deja/g++.other/dtor1.C: Remove stray semicolon.
* g++.old-deja/g++.other/dtor10.C: Likewise.
* g++.old-deja/g++.other/incomplete.C: Likewise.
* g++.old-deja/g++.other/linkage7.C: Likewise.
* g++.old-deja/g++.other/lookup19.C: Now fails due to corrected
lookup algorithm.
* g++.old-deja/g++.other/mangle2.C: Likewise.
* g++.old-deja/g++.other/refinit2.C: Likewise.
* g++.old-deja/g++.other/sizeof2.C: Change error messages.
* g++.old-deja/g++.other/std1.C: Remove stray semicolon.
* g++.old-deja/g++.pt/crash28.C: Likewise.
* g++.old-deja/g++.pt/crash29.C: Use explicit specialization
syntax.
* g++.old-deja/g++.pt/crash32.C: Change error message.
* g++.old-deja/g++.pt/crash43.C: Adjust error messages.
* g++.old-deja/g++.pt/crash58.C: Remove stray semicolon.
* g++.old-deja/g++.pt/crash65.C: Tweak to acount for change in
error message position.
* g++.old-deja/g++.pt/defarg5.C: Remove stray semicolon.
* g++.old-deja/g++.pt/defarg8.C: Change error message.
* g++.old-deja/g++.pt/eichin01.C: Use explicit specialization
syntax.
* g++.old-deja/g++.pt/eichin01a.C: Define static data members.
* g++.old-deja/g++.pt/eichin01b.C: Likewise.
* g++.old-deja/g++.pt/enum7.C: Remove stray semicolon.
* g++.old-deja/g++.pt/explicit12.C: Remove invalid use of template
keyword.
* g++.old-deja/g++.pt/explicit31.C: Likewise.
* g++.old-deja/g++.pt/explicit33.C: Remove stray semicolon.
* g++.old-deja/g++.pt/explicit35.C: Remove invalid use of template
keyword.
* g++.old-deja/g++.pt/explicit71.C: Change error message.
* g++.old-deja/g++.pt/explicit80.C: Use explicit specialization
syntax.
* g++.old-deja/g++.pt/friend28.C: Account for use of
non-dependent names.
* g++.old-deja/g++.pt/friend29.C: Likewise.
* g++.old-deja/g++.pt/friend46.C: Adjust for correct name lookup
rules.
* g++.old-deja/g++.pt/friend48.C: Remove stray semicolon.
* g++.old-deja/g++.pt/instantiate1.C: Use correct class-key.
* g++.old-deja/g++.pt/instantiate11.C: Adjust for correct name
lookup rules.
* g++.old-deja/g++.pt/instantiate8.C: Remove stray semicolon.
* g++.old-deja/g++.pt/instantiate9.C: Insert missing typename
keyword.
* g++.old-deja/g++.pt/memclass20.C: Likewise.
* g++.old-deja/g++.pt/memclass5.C: Likewise.
* g++.old-deja/g++.pt/memclass7.C: Remove invalid use of template
keyword.
* g++.old-deja/g++.pt/memtemp75.C: Likewise.
* g++.old-deja/g++.pt/memtemp81.C: Remove stray semicolon.
* g++.old-deja/g++.pt/memtemp87.C: Add missing access specifier.
* g++.old-deja/g++.pt/overload13.C: Correct error messages.
* g++.old-deja/g++.pt/parms2.C: Add missing typename keyword.
* g++.old-deja/g++.pt/ptrmem1.C: Remove invalid use of template
keyword.
* g++.old-deja/g++.pt/spec10.C: Likewise.
* g++.old-deja/g++.pt/spec28.C: Reorder declarations.
* g++.old-deja/g++.pt/t10.C: Add explicit specialization syntax.
* g++.old-deja/g++.pt/t32.C: Remove stray semicolon.
* g++.old-deja/g++.pt/t35a.C: Add explicit specialization syntax.
* g++.old-deja/g++.pt/ttp24.C: Remove stray semicolon.
* g++.old-deja/g++.pt/ttp62.C: Likewise.
* g++.old-deja/g++.pt/ttp64.C: Likewise.
* g++.old-deja/g++.pt/typename11.C: Add missing typename keyword.
* g++.old-deja/g++.pt/typename15.C: Likewise.
* g++.old-deja/g++.pt/typename22.C: Likewise.
* g++.old-deja/g++.pt/typename6.C: Change error messages.
* g++.old-deja/g++.pt/using1.C: Remove stray semicolon.
* g++.old-deja/g++.pt/virtual2.C: Likewise.
* g++.old-deja/g++.robertl/eb118.C: Add explicit specialization
syntax.
* g++.old-deja/g++.robertl/eb27.C: Now fails due to use of named
return value extension.
* g++.old-deja/g++.robertl/eb43.C: Remove stray semicolon.
* g++.old-deja/g++.robertl/eb79.C: Correct for new name lookup rules.
* g++.old-deja/g++.robertl/eb82.C: Remove stray semicolons.
* g++.old-deja/g++.robertl/eb86.C: Add missing forward declaration.
2002-12-26 Nathan Sidwell <nathan@codesourcery.com> 2002-12-26 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/warn/inline1.C: New test. * g++.dg/warn/inline1.C: New test.
......
...@@ -14,4 +14,4 @@ public: ...@@ -14,4 +14,4 @@ public:
typedef HandlerStack<std::set_terminate> Terminate; typedef HandlerStack<std::set_terminate> Terminate;
template<> void Terminate::defaultHandler() {}; template<> void Terminate::defaultHandler() {}
...@@ -13,7 +13,7 @@ struct A ...@@ -13,7 +13,7 @@ struct A
void h() void h()
{ {
void (A::*p)() = &A::f; void (A::*p)() = &A::f;
void (A::*q)() = &(A::f); // { dg-error "parenthesis" "" } void (A::*q)() = &(A::f); // { dg-error "parenthesized" "" }
foo(&g<int>); // { dg-error "" "" } foo(&g<int>); // { dg-error "" "" }
} }
}; };
...@@ -20,7 +20,7 @@ int foo (void) ...@@ -20,7 +20,7 @@ int foo (void)
[third] "i" (j + 2), [third] "i" (j + 2),
[fourth] "i" (100)); [fourth] "i" (100));
return i; return i;
}; }
template<class TYPE> template<class TYPE>
TYPE bar (TYPE t) TYPE bar (TYPE t)
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
// { dg-options "-fpermissive -w" } // { dg-options "-fpermissive -w" }
template <class T> struct A { typedef int X; }; template <class T> struct A { typedef int X; };
template <class T> struct B { typedef A<T> Y; void f (Y::X); }; template <class T> struct B { typedef A<T> Y; void f (typename Y::X); };
template <class T, class T1, class T2, class T3> struct C : public B<T> { void g (Y::X); }; template <class T, class T1, class T2, class T3> struct C : public B<T> { void g (typename Y::X); };
template class B<int>; template class B<int>;
...@@ -6,4 +6,4 @@ namespace N ...@@ -6,4 +6,4 @@ namespace N
template<typename> struct X { }; template<typename> struct X { };
} }
struct A : N::X { }; // { dg-error "invalid base-class" "" } struct A : N::X { }; // { dg-error "expected class-name" "" }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
struct A struct A
{ {
static int i1; static int i1;
int i2; int i2; // { dg-error "inaccessible" "" }
static void f1 (); static void f1 ();
void f2 (); void f2 ();
}; };
...@@ -15,7 +15,7 @@ struct C: public B ...@@ -15,7 +15,7 @@ struct C: public B
void g () void g ()
{ {
::A::i1 = 1; ::A::i1 = 1;
::A::i2 = 1; // { dg-error "access" "" } ::A::i2 = 1; // { dg-error "(access)|(context)" "" }
::A::f1 (); ::A::f1 ();
::A::f2 (); // { dg-error "access" "" { xfail *-*-* } } ::A::f2 (); // { dg-error "access" "" { xfail *-*-* } }
} }
......
...@@ -13,7 +13,7 @@ struct Derived : Base ...@@ -13,7 +13,7 @@ struct Derived : Base
{ {
void Foo () void Foo ()
{ {
Base::Baz (); // { dg-error "has no member" "" } Base::Baz (); // { dg-error "is not a member" "" }
}; };
}; };
...@@ -20,4 +20,4 @@ struct C : public B ...@@ -20,4 +20,4 @@ struct C : public B
}; };
template C<int>; template struct C<int>;
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -25,7 +25,7 @@ namespace N ...@@ -25,7 +25,7 @@ namespace N
template<int> void f() {} template<int> void f() {}
} }
using N; // { dg-error "parse error" "" } using N; // { dg-error "(using-declaration)|(nested-name)" "" }
using ::N; // { dg-error "using-declaration" "" } using ::N; // { dg-error "using-declaration" "" }
using N::f< 0 >; // { dg-error "using-declaration" "" } using N::f< 0 >; // { dg-error "using-declaration" "" }
...@@ -41,6 +41,6 @@ struct B : A { ...@@ -41,6 +41,6 @@ struct B : A {
struct C : A { struct C : A {
using A::f<double>; // { dg-error "using-declaration" "" } using A::f<double>; // { dg-error "using-declaration" "" }
using A::X<int>; // { dg-error "parse error" "" } using A::X<int>; // { dg-error "using-declaration" "" }
}; };
// { dg-do compile } // { dg-do compile }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 28 Dec 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 28 Dec 2001 <nathan@codesourcery.com>
// PR 5123. ICE // PR 5123. ICE
...@@ -26,4 +26,4 @@ void Foo () { ...@@ -26,4 +26,4 @@ void Foo () {
c.g == 1; // { dg-error "invalid use of" "" } c.g == 1; // { dg-error "invalid use of" "" }
c.f == 1; // { dg-error "invalid use of" "" } c.f == 1; // { dg-error "invalid use of" "" }
c.f<int> == 1; // { dg-error "invalid use of" "" } c.f<int> == 1; // { dg-error "invalid use of" "" }
}; }
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
void init () void init ()
{ {
do { } while (0) do { } while (0)
obj = 0; // { dg-error "parse error" "" } obj = 0; // { dg-error "expected|undeclared" "" }
} }
...@@ -10,5 +10,5 @@ namespace N ...@@ -10,5 +10,5 @@ namespace N
class B { friend void operator>>(int, class B); }; class B { friend void operator>>(int, class B); };
class N { friend void operator>>(int,class N); }; class N { friend void operator>>(int,class N); };
} }
void N::operator>>(int, N::B) // { dg-error "no type `B' in `N::N'" "" } void N::operator>>(int, N::B) // { dg-error "`B' is not a member of `class N::N'|non-function|primary-expression" "" }
{ } // { dg-error "" "" } { } // { dg-error "" "" }
// { dg-do compile } // { dg-do compile }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 13 Nov 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 13 Nov 2001 <nathan@codesourcery.com>
// Bug 3154 // Bug 3154
...@@ -17,7 +17,7 @@ struct B : A ...@@ -17,7 +17,7 @@ struct B : A
class T class T
{ {
typedef int Foo; typedef int Foo;
T () : Foo () {} // { dg-error "type `T::Foo' is not" "" } T () : Foo () {} // { dg-error "T::Foo' is not" "" }
}; };
struct S : B struct S : B
......
...@@ -19,4 +19,4 @@ int main () ...@@ -19,4 +19,4 @@ int main ()
return 0; return 0;
}; }
// { dg-do compile } // { dg-do compile }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 31 Dec 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 31 Dec 2001 <nathan@codesourcery.com>
// PR 4379. We created pointers to member references and pointers to // PR 4379. We created pointers to member references and pointers to
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
struct D { struct D {
int &m; // { dg-error "member `D::m' is non-static" "" } int &m; // { dg-error "invalid use of non-static data member" "" }
static int &s; static int &s;
int Foo (); int Foo ();
...@@ -29,7 +29,7 @@ int D::Foo () ...@@ -29,7 +29,7 @@ int D::Foo ()
int Foo () int Foo ()
{ {
f1( &D::m); // { dg-error "cannot create pointer to ref" "" } f1( &D::m); // { dg-error "cannot create pointer to ref" "" }
f1( &(D::m)); // { dg-error "at this point" "" } f1( &(D::m)); // { dg-error "from this location" "" }
f2( &D::s); // ok f2( &D::s); // ok
f2( &(D::s)); // ok f2( &(D::s)); // ok
return 0; return 0;
......
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
// { dg-do compile } // { dg-do compile }
struct { struct {
a(void = 0; a(0), a(0) // { dg-error "" "" { target *-*-* } 7 } a(void = 0; a(0), a(0) // { dg-error "" "" { target *-*-* } }
...@@ -19,7 +19,7 @@ extern Two goo; ...@@ -19,7 +19,7 @@ extern Two goo;
extern Two coo[]; extern Two coo[];
extern Two koo[]; extern Two koo[];
Two foo( 5, 6 ) __attribute__((init_priority(1005))); Two foo __attribute__((init_priority(1005))) ( 5, 6 );
Two goo __attribute__((init_priority(1007))) = Two( 7, 8 ); Two goo __attribute__((init_priority(1007))) = Two( 7, 8 );
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// Enforcing access of typename type. // Enforcing access of typename type.
template <class T> struct A { template <class T> struct A {
typename T::X<int> x; // { dg-error "this context" } typename T::template X<int> x; // { dg-error "this context" }
}; };
class B { class B {
......
...@@ -16,6 +16,6 @@ class Outer { ...@@ -16,6 +16,6 @@ class Outer {
template <int dim> template <int dim>
typename Outer::Inner<dim>::T Outer::Inner<dim>::foo () { typename Outer::Inner<dim>::T Outer::Inner<dim>::foo () {
return 1; return 1;
}; }
template Outer::Inner<2>; template struct Outer::Inner<2>;
...@@ -11,7 +11,7 @@ template <class> class Base { ...@@ -11,7 +11,7 @@ template <class> class Base {
template <class T> struct Derived : public Base<T> { template <class T> struct Derived : public Base<T> {
typedef typename Base<T>::Type Type; typedef typename Base<T>::Type Type;
template <class Arg> void f(Type = Type()) {}; template <class Arg> void f(Type = Type()) {}
}; };
template void Derived<char>::f<int> (Type); template void Derived<char>::f<int> (Type);
...@@ -6,6 +6,6 @@ template <int D> struct C { ...@@ -6,6 +6,6 @@ template <int D> struct C {
}; };
template<int D> template<int D>
C<D>::C() : d((int[]){1,2,3}) {}; C<D>::C() : d((int[]){1,2,3}) {}
template class C<1>; template class C<1>;
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
class S class S
{ {
public: public:
template <class I> void Foo(int (*f)(S& o) ); // { dg-error "candidate" "" } template <class I> void Foo(int (*f)(S& o) );
}; };
template <class I> template <class I>
void S::Foo(int (*f)(TYPO&o) ) void S::Foo(int (*f)(TYPO&o) ) // { dg-error "Foo" }
{ // { dg-error "template definition|variable declaration|prototype" "" } { // { dg-error "expected `;'" }
} }
...@@ -16,4 +16,4 @@ struct B: public A { ...@@ -16,4 +16,4 @@ struct B: public A {
int main() int main()
{ {
B<int> a; B<int> a;
}; }
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
// PR c++/2862 // PR c++/2862
// Default function argument and template instantiation. // Default function argument and template instantiation.
template <int dim> void f (int=0) {}; template <int dim> void f (int=0) {}
template void f<1> (); // { dg-error "not match" } template void f<1> (); // { dg-error "not match" }
...@@ -10,7 +10,7 @@ template <class TYPE> ...@@ -10,7 +10,7 @@ template <class TYPE>
struct ACE_Cleanup_Adapter struct ACE_Cleanup_Adapter
{ {
TYPE &object () TYPE &object ()
{ return object_; } // { dg-error "no member" } { return object_; } // { dg-error "undeclared|reported" }
TYPE object_; // { dg-error "incomplete type" } TYPE object_; // { dg-error "incomplete type" }
}; };
......
...@@ -7,7 +7,7 @@ public: ...@@ -7,7 +7,7 @@ public:
void sort (int (*compare) (T *const&,T *const&)); void sort (int (*compare) (T *const&,T *const&));
}; };
int shift_compare (int *const &, int *const &) {}; int shift_compare (int *const &, int *const &) {}
template<class T> void template<class T> void
Link_array<T>::sort (int (*compare) (T *const&,T *const&)) Link_array<T>::sort (int (*compare) (T *const&,T *const&))
......
// Copyright (C) 2001 Free Software Foundation // Copyright (C) 2001, 2002 Free Software Foundation
// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> // Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
// { dg-do compile } // { dg-do compile }
...@@ -14,7 +14,7 @@ template <template <class> class TT> struct X ...@@ -14,7 +14,7 @@ template <template <class> class TT> struct X
struct C struct C
{ {
X<A::template B> x; // { dg-error "template|forbid" } X<A::template B> x; // { dg-error "" }
}; };
int main() int main()
......
class a {} a1; class a {} a1;
template <a & p> class b { public: b() { static_cast <a &> (p); }; }; template <a & p> class b { public: b() { static_cast <a &> (p); }; };
int main() { b <a1> b1; }; int main() { b <a1> b1; }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// { dg-do compile } // { dg-do compile }
template <unsigned I> struct A {}; template <unsigned I> struct A { static char *value; };
template <typename SizeType> template <typename SizeType>
struct B struct B
......
...@@ -8,4 +8,4 @@ struct X { ...@@ -8,4 +8,4 @@ struct X {
template <int dim> void f(int=0); template <int dim> void f(int=0);
}; };
template <> void X::f<1> () {} // { dg-error "(not match|syntax error)" } template <> void X::f<1> () {} // { dg-error "(not match|declaration)" }
template <typename T> struct A template <typename T> struct A
{ {
static const int t[1][1]={{0}}; // { dg-error "in-class" } static const int t[1][1]={{0}}; // { dg-error "brace-enclosed|in-class" }
}; };
...@@ -5,4 +5,4 @@ struct A { ...@@ -5,4 +5,4 @@ struct A {
}; };
int A::B::c; // { dg-error "parameters" } int A::B::c; // { dg-error "parameters" }
int A::C::d; // { dg-error "no type" } int A::C::d; // { dg-error "class" }
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
template <class A> template <class A>
struct B { struct B {
typedef A::C::D E; // { dg-error "no type|parse error" } typedef A::C::D E; // { dg-error "" }
}; };
...@@ -19,7 +19,7 @@ protected: ...@@ -19,7 +19,7 @@ protected:
static const hand_table table_1[]; static const hand_table table_1[];
static const AData table_2; static const AData table_2;
private: private:
void foo (void); // ERROR - candidate void foo (void);
}; };
const hand_table Agent::table_1[] = const hand_table Agent::table_1[] =
......
...@@ -24,6 +24,6 @@ enum { first, last}; ...@@ -24,6 +24,6 @@ enum { first, last};
void foo(void) { void foo(void) {
sanjose obj(first); // ERROR - // ERROR - sanjose obj(first); // ERROR - // ERROR -
}; }
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
void bar ( bool x ) {}; void bar ( bool x ) {}
void bars ( short x ) {}; void bars ( short x ) {}
/* 980326 bkoz this is not initialized and so can have indeterminate value. */ /* 980326 bkoz this is not initialized and so can have indeterminate value. */
#if 0 #if 0
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include <assert.h> #include <assert.h>
void bar ( bool x ) {}; void bar ( bool x ) {}
void bars ( short x ) {}; void bars ( short x ) {}
#if 0 #if 0
int andb(){ int andb(){
......
...@@ -7,5 +7,5 @@ public: ...@@ -7,5 +7,5 @@ public:
explicit Foo (int){} explicit Foo (int){}
}; };
Foo f(10); Foo f(10);
Foo blat() return f(4){}; //this should not give an error Foo blat() return f(4){} // ERROR - named return value
...@@ -126,7 +126,7 @@ public: ...@@ -126,7 +126,7 @@ public:
template <class T161> template <class T161>
friend bool foo(T161 u) friend bool foo(T161 u)
{ {
Xseven<T161, 5, int> obj; Xseven<T161, 5, int> obj; // ERROR - .*
return (obj.inst == u.inst); return (obj.inst == u.inst);
} }
......
...@@ -17,7 +17,7 @@ template<class T> ...@@ -17,7 +17,7 @@ template<class T>
void blah (const T &) { void blah (const T &) {
T y; T y;
x (4); x (4);
}; }
int main () { int main () {
const foo<int> v; const foo<int> v;
......
...@@ -12,7 +12,7 @@ void f (void) { ...@@ -12,7 +12,7 @@ void f (void) {
catch( int) catch( int)
{ {
} }
}; }
// //
//2 g++/12923 __attribute__((__unused__)) not working for objects //2 g++/12923 __attribute__((__unused__)) not working for objects
...@@ -77,7 +77,7 @@ int foofunc(T x){ ...@@ -77,7 +77,7 @@ int foofunc(T x){
Mutex sm(2); Mutex sm(2);
AutoMutex m(&sm); AutoMutex m(&sm);
return 0; return 0;
}; }
//5 sanity check to make sure other attributes cannot be used //5 sanity check to make sure other attributes cannot be used
......
...@@ -4,6 +4,6 @@ extern "C" { ...@@ -4,6 +4,6 @@ extern "C" {
public: public:
void a(); void a();
}; };
}; }
void A::a() {} void A::a() {}
...@@ -16,7 +16,7 @@ public: ...@@ -16,7 +16,7 @@ public:
}; };
void f(B b) { void f(B b) {
}; }
void g() { void g() {
B h; B h;
......
...@@ -9,7 +9,7 @@ extern "C" { ...@@ -9,7 +9,7 @@ extern "C" {
int printf (const char *, ...); int printf (const char *, ...);
void exit (int); void exit (int);
void abort (void); void abort (void);
}; }
__complex__ double cd; __complex__ double cd;
......
...@@ -49,7 +49,7 @@ void BaseClass::Increm( int r ) ...@@ -49,7 +49,7 @@ void BaseClass::Increm( int r )
i += r; i += r;
else else
die (); die ();
}; }
class DerivedClass : public BaseClass { class DerivedClass : public BaseClass {
public: public:
......
...@@ -31,7 +31,7 @@ gen_op Spul_U_axis() ...@@ -31,7 +31,7 @@ gen_op Spul_U_axis()
{ {
gen_op U1; gen_op U1;
U1 = Fe(); U1 = Fe();
}; // ERROR - reaches end of non-void function } // ERROR - reaches end of non-void function
int int
main () {}; main () {}
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
class A { class A {
public: public:
virtual ~A() {std::cout << "executed ~A()\n";}; virtual ~A() {std::cout << "executed ~A()\n";}
}; };
class B : public A { class B : public A {
public: public:
virtual ~B() {std::cout << "executed ~B()\n";}; virtual ~B() {std::cout << "executed ~B()\n";}
}; };
int int
...@@ -18,5 +18,5 @@ main() { ...@@ -18,5 +18,5 @@ main() {
B b; B b;
b.~A();// ERROR - destructor b.~A();// ERROR - destructor
std::cout << "done\n"; std::cout << "done\n";
}; }
...@@ -13,5 +13,5 @@ public: ...@@ -13,5 +13,5 @@ public:
{ return v != index; }// ERROR - .* { return v != index; }// ERROR - .*
private: private:
// friend class List<T>; // friend class List<T>;
element *index; element *index; // ERROR - invalid use of member
}; };
...@@ -6,7 +6,7 @@ extern "C" { ...@@ -6,7 +6,7 @@ extern "C" {
} }
extern "C" { extern "C" {
extern void foo(); extern void foo();
}; }
class SS { class SS {
friend void foo(); friend void foo();
protected: protected:
......
...@@ -37,7 +37,7 @@ main() ...@@ -37,7 +37,7 @@ main()
Implicit<Implicit<INTEGER, 2> , 3> y; Implicit<Implicit<INTEGER, 2> , 3> y;
y = 10; y = 10;
}; }
...@@ -5,7 +5,7 @@ class B ...@@ -5,7 +5,7 @@ class B
public: public:
int i; int i;
}; };
int operator & (const B &s) { return ( s.i );}; int operator & (const B &s) { return ( s.i );}
......
...@@ -341,7 +341,7 @@ operator>=(const SetLD<T>& a, const SetLD<T>& b) ...@@ -341,7 +341,7 @@ operator>=(const SetLD<T>& a, const SetLD<T>& b)
{ return ! (a < b); } { return ! (a < b); }
class String { }; class String { };
class IcaseString: public String { }; class IcaseString: public String { };
class SetLD< IcaseString >: public SetLD< String > { public: SetLD (): SetLD< String >() { }; SetLD (const ListD< IcaseString >& other): SetLD< String >() { ListD< IcaseString >::Vix x; for (other.first(x); 0 != x; other.next(x)) add(other(x)); }; SetLD (const SetLD & other): SetLD< String >(other) { }; const IcaseString & operator()(const Vix& x) const { return ( IcaseString &) SetLD< String >::operator()(x); } }; typedef SetLD< String > SetLD_String_IcaseString_old_tmp99; typedef SetLD< IcaseString > SetLD_String_IcaseString_new_tmp99; template <> class SetLD< IcaseString >: public SetLD< String > { public: SetLD (): SetLD< String >() { }; SetLD (const ListD< IcaseString >& other): SetLD< String >() { ListD< IcaseString >::Vix x; for (other.first(x); 0 != x; other.next(x)) add(other(x)); }; SetLD (const SetLD & other): SetLD< String >(other) { }; const IcaseString & operator()(const Vix& x) const { return ( IcaseString &) SetLD< String >::operator()(x); } }; typedef SetLD< String > SetLD_String_IcaseString_old_tmp99; typedef SetLD< IcaseString > SetLD_String_IcaseString_new_tmp99;
inline int operator== (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) inline int operator== (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b)
{// ERROR - candidate for call {// ERROR - candidate for call
const SetLD_String_IcaseString_old_tmp99& oa = a; const SetLD_String_IcaseString_old_tmp99& oa = a;
...@@ -371,7 +371,7 @@ inline int operator>= (const SetLD_String_IcaseString_new_tmp99& a, const SetLD ...@@ -371,7 +371,7 @@ inline int operator>= (const SetLD_String_IcaseString_new_tmp99& a, const SetLD
{ {
const SetLD_String_IcaseString_old_tmp99& oa = a; const SetLD_String_IcaseString_old_tmp99& oa = a;
const SetLD_String_IcaseString_old_tmp99& ob = b; const SetLD_String_IcaseString_old_tmp99& ob = b;
return operator>= (oa, ob); } ; return operator>= (oa, ob); }
typedef SetLD<IcaseString> SLDiS; typedef SetLD<IcaseString> SLDiS;
static void static void
nop(int i) nop(int i)
......
...@@ -9,6 +9,7 @@ template<int> ...@@ -9,6 +9,7 @@ template<int>
class Program { class Program {
} ; } ;
template<>
class Program<0> { class Program<0> {
public: public:
inline friend float EvalNextArg() inline friend float EvalNextArg()
......
...@@ -23,7 +23,7 @@ swaplong(ulong value) ...@@ -23,7 +23,7 @@ swaplong(ulong value)
{ {
ulong v = (value << 16) | (value >> 16); ulong v = (value << 16) | (value >> 16);
return ((v >> 8) & 0x00ff00ff) | ((v << 8) & 0xff00ff00); return ((v >> 8) & 0x00ff00ff) | ((v << 8) & 0xff00ff00);
}; }
struct elong struct elong
{ {
ulong data; ulong data;
......
...@@ -8,5 +8,5 @@ class Elvis ...@@ -8,5 +8,5 @@ class Elvis
template<int a> template<int a>
class Elvis<0> class Elvis<0>
{ // ERROR - incorrect number of parameters { // ERROR - incorrect number of parameters
int geta() { return a ; } // ERROR - not in a class int geta() { return a ; }
} ; } ;
...@@ -24,4 +24,4 @@ base::base(int arg1, int arg2) ...@@ -24,4 +24,4 @@ base::base(int arg1, int arg2)
{ {
f1 = arg1; f1 = arg1;
f2 = arg2; f2 = arg2;
}; }
...@@ -25,4 +25,4 @@ base::base(int arg1, int arg2) ...@@ -25,4 +25,4 @@ base::base(int arg1, int arg2)
{ {
f1 = arg1; f1 = arg1;
f2 = arg2; f2 = arg2;
}; }
...@@ -5,4 +5,4 @@ void f( int a) { ...@@ -5,4 +5,4 @@ void f( int a) {
{ {
int a; int a;
} }
}; }
...@@ -24,7 +24,7 @@ aCallback<Called>::aCallback(Called& obj, ...@@ -24,7 +24,7 @@ aCallback<Called>::aCallback(Called& obj,
int (Called::*met)()) : int (Called::*met)()) :
object(obj), object(obj),
method(met) method(met)
{}; {}
template <class Called> template <class Called>
int aCallback<Called>::callback() int aCallback<Called>::callback()
......
...@@ -18,10 +18,10 @@ template <int I> class BB : public virtual V { ...@@ -18,10 +18,10 @@ template <int I> class BB : public virtual V {
BB(int); BB(int);
}; };
template <int I> AA<I>::AA() {}; template <int I> AA<I>::AA() {}
template <int I> AA<I>::AA(int i): V(i) {}; template <int I> AA<I>::AA(int i): V(i) {}
template <int I> BB<I>::BB() {}; template <int I> BB<I>::BB() {}
template <int I> BB<I>::BB(int i) {}; template <int I> BB<I>::BB(int i) {}
class CC : public AA<1>, public BB<2> { class CC : public AA<1>, public BB<2> {
public: public:
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
class X1 { }; class X1 { };
class RefProto { }; class RefProto { };
template<class REP> class Ref { }; template<class REP> class Ref { };
template <>
class MapLS<String, Ref<X1> >: public MapLS<String, RefProto> { class MapLS<String, Ref<X1> >: public MapLS<String, RefProto> {
public: public:
~MapLS(); ~MapLS();
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
class X1 { }; class X1 { };
class RefProto { }; class RefProto { };
template<class REP> class Ref { }; template<class REP> class Ref { };
template <>
class MapLS<String, Ref<X1> >: public MapLS<String, RefProto> { class MapLS<String, Ref<X1> >: public MapLS<String, RefProto> {
public: public:
~MapLS(); ~MapLS();
......
...@@ -18,16 +18,16 @@ Vector<T>::Vector(int x) ...@@ -18,16 +18,16 @@ Vector<T>::Vector(int x)
{ {
sz = x; sz = x;
v = new T (sz); v = new T (sz);
} ; }
template<class T> template<class T>
Vector<T>::~Vector() Vector<T>::~Vector()
{ delete [] v; } ; { delete [] v; }
template<class T> template<class T>
T & T &
Vector<T>::operator [] (int i) Vector<T>::operator [] (int i)
{ return v[i]; } ; { return v[i]; }
int int
main(int, char **) main(int, char **)
......
...@@ -7,6 +7,13 @@ ...@@ -7,6 +7,13 @@
class A {}; class A {};
template <class TP> template <class TP>
class B;
template <class TP>
inline A &
operator<< (A &o, const B<TP> &m);
template <class TP>
class B class B
{ {
A &(*_f) (A &, TP); A &(*_f) (A &, TP);
......
...@@ -7,4 +7,4 @@ main () ...@@ -7,4 +7,4 @@ main ()
int * foo = &x; // in C++ it's perfectly legal to do this int * foo = &x; // in C++ it's perfectly legal to do this
return 0; return 0;
}; }
...@@ -18,4 +18,4 @@ x() ...@@ -18,4 +18,4 @@ x()
x.kill(0); x.kill(0);
X<Y> y; X<Y> y;
y.kill(0); y.kill(0);
}; }
...@@ -44,6 +44,6 @@ void function () ...@@ -44,6 +44,6 @@ void function ()
u0 u0_object_1; u0 u0_object_1;
u0_object_0 = u0_object_1; u0_object_0 = u0_object_1;
}; }
int main () { return 0; } int main () { return 0; }
// Test pointer chain catching // Test pointer chain catching
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 9 Apr 2000 <nathan@nathan@codesourcery.com> // Contributed by Nathan Sidwell 9 Apr 2000 <nathan@nathan@codesourcery.com>
#include <stdio.h> #include <stdio.h>
void fn () {}; void fn () {}
struct A {void fn () {}}; struct A {void fn () {}};
static int var = 1; static int var = 1;
static const int const_var = 2; static const int const_var = 2;
......
...@@ -21,4 +21,4 @@ int main() ...@@ -21,4 +21,4 @@ int main()
fn1 = a.f; fn1 = a.f;
fn1 = (pmf1)a.f; fn1 = (pmf1)a.f;
fn2 = (pmf2)a.f; fn2 = (pmf2)a.f;
}; }
...@@ -5,8 +5,8 @@ extern "C" int printf (const char *, ...); ...@@ -5,8 +5,8 @@ extern "C" int printf (const char *, ...);
class A { class A {
public: public:
static A*func (int = 3); static A*func (int = 3);
static A*(*ptr)(int = 4); static A*(*ptr)(int = 4); // ERROR - .*
}; };
A*(*A::ptr)(int) = &A::func; A*(*A::ptr)(int) = &A::func;
...@@ -15,7 +15,7 @@ int main() ...@@ -15,7 +15,7 @@ int main()
{ {
A foo; A foo;
A::ptr(); A::ptr(); // ERROR - .*
A::ptr(47); A::ptr(47);
} }
......
// Special g++ Options: -Wno-deprecated // Special g++ Options: -Wno-deprecated
int f(int x) return y(x) { } int f(int x) return y(x) { } // ERROR -
extern "C" void abort (); extern "C" void abort ();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// The Alpha ABI specifies that 32-bit return values have bit 31 propagated, // The Alpha ABI specifies that 32-bit return values have bit 31 propagated,
// i.e. the value is sign-extended even if the unpromoted type is unsigned. // i.e. the value is sign-extended even if the unpromoted type is unsigned.
unsigned int f(unsigned int x) return y(x) { } unsigned int f(unsigned int x) return y(x) { } // ERROR -
extern "C" void abort (); extern "C" void abort ();
......
...@@ -8,9 +8,9 @@ int f2(int *x) ...@@ -8,9 +8,9 @@ int f2(int *x)
return 2; return 2;
} }
int f1() return x int f1() return x // ERROR -
{ {
f2(&x); f2(&x); // ERROR -
} }
void g() void g()
......
...@@ -7,9 +7,9 @@ void f (int &i) ...@@ -7,9 +7,9 @@ void f (int &i)
i = 42; i = 42;
} }
int g () return r int g () return r // ERROR - named return value
{ {
f (r); f (r); // ERROR - undeclared
} }
int main () int main ()
......
// Bug: g++ forgets about the instantiation of class1 when looking up // Bug: g++ forgets about the instantiation of class1 when looking up
// class11_value, and tries to look things up in class1<class2>. // class11_value, and tries to look things up in class1<class2>.
// Special g++ Options:
template<class ItIsInt> template<class ItIsInt>
struct class1 { struct class1 {
struct class11 { struct class11 {
...@@ -18,7 +16,7 @@ struct class3 { ...@@ -18,7 +16,7 @@ struct class3 {
template<class ItIsClass2> template<class ItIsClass2>
int class3<ItIsClass2>::f() int class3<ItIsClass2>::f()
{ {
return class1<typename ItIsClass2::class2_value>::class11::class11_value(10); return typename class1<typename ItIsClass2::class2_value>::class11::class11_value(10);
} }
struct class2 { struct class2 {
......
...@@ -12,8 +12,8 @@ struct B: public A { ...@@ -12,8 +12,8 @@ struct B: public A {
static int (A::*fp)(); static int (A::*fp)();
}; };
int A::* B::p = &A::i; int A::* B::p = &A::i; // ERROR -
int (A::* B::fp)() = &A::f; int (A::* B::fp)() = &A::f; // ERROR -
struct C { struct C {
static int A::*p; static int A::*p;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Bug: g++ forgets access decls after the definition. // Bug: g++ forgets access decls after the definition.
// Build don't link: // Build don't link:
class inh { class inh { // ERROR - inaccessible
int a; int a;
protected: protected:
void myf(int); void myf(int);
......
...@@ -31,7 +31,7 @@ void g () ...@@ -31,7 +31,7 @@ void g ()
template <class T> struct F { }; template <class T> struct F { };
template class F<bool>; template class F<bool>;
template <class T> void f (T, bool) { }; template <class T> void f (T, bool) { }
template void f (bool, bool); template void f (bool, bool);
/* Special cases. */ /* Special cases. */
......
...@@ -14,6 +14,7 @@ public: ...@@ -14,6 +14,7 @@ public:
}; };
typedef char * cp; typedef char * cp;
typedef int I;
int main () int main ()
{ {
...@@ -22,10 +23,10 @@ int main () ...@@ -22,10 +23,10 @@ int main ()
int i; int i;
cp c; cp c;
i.~int(); i.~I();
i.int::~int(); i.I::~I();
(&i)->~int(); (&i)->~I();
(&i)->int::~int(); (&i)->I::~I();
c.~cp(); c.~cp();
c.cp::~cp(); c.cp::~cp();
(&c)->~cp(); (&c)->~cp();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <stddef.h> #include <stddef.h>
void *operator new(size_t Size, void* pThing) { return pThing; }; void *operator new(size_t Size, void* pThing) { return pThing; }
template <class T> class Stack { template <class T> class Stack {
public: public:
......
...@@ -18,7 +18,8 @@ int main() ...@@ -18,7 +18,8 @@ int main()
int* p = (int*) new char[sizeof (int)]; int* p = (int*) new char[sizeof (int)];
new (p + r++) int; new (p + r++) int;
p[--r].~int(); typedef int I;
p[--r].~I();
return r; return r;
} }
...@@ -12,4 +12,4 @@ void foo () ...@@ -12,4 +12,4 @@ void foo ()
int one=1, two=2; int one=1, two=2;
X a(one), b(two); X a(one), b(two);
a = b; // ERROR - no assignment semantics defined a = b; // ERROR - no assignment semantics defined
}; }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
enum E { A=5, B=32, C=100 }; enum E { A=5, B=32, C=100 };
E operator|(E a, E b) { return C; }; E operator|(E a, E b) { return C; }
int main() int main()
{ {
......
...@@ -16,4 +16,4 @@ void f( const D & ); ...@@ -16,4 +16,4 @@ void f( const D & );
void g( const X & x ) void g( const X & x )
{ {
f( x ); f( x );
}; }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class aClass class aClass
{ {
; ; // ERROR - missing declaration
private: private:
; // This line causes problems ; // ERROR - missing declaration
}; };
...@@ -20,7 +20,7 @@ aCallback<Called>::aCallback(Called& obj, ...@@ -20,7 +20,7 @@ aCallback<Called>::aCallback(Called& obj,
int (Called::*met)()) : int (Called::*met)()) :
object(obj), object(obj),
method(met) method(met)
{}; {}
template <class Called> template <class Called>
int aCallback<Called>::callback() int aCallback<Called>::callback()
......
...@@ -12,7 +12,7 @@ struct X { ...@@ -12,7 +12,7 @@ struct X {
const X foo() { const X foo() {
return X(3); return X(3);
}; }
int main() int main()
{ {
......
...@@ -14,7 +14,7 @@ struct Y { ...@@ -14,7 +14,7 @@ struct Y {
Y foo() { Y foo() {
return X(3); return X(3);
}; }
int main() int main()
{ {
......
...@@ -8,7 +8,7 @@ private: ...@@ -8,7 +8,7 @@ private:
int foo; int foo;
}; };
void x::fun() { }; void x::fun() { }
main () main ()
{ {
......
// Make sure that forward declarations of specializations work... // Make sure that forward declarations of specializations work...
template <class T> class A { }; template <class T> class A { };
class A<int>; template <> class A<int>;
A<int> a; // ERROR - incomplete type A<int> a; // ERROR - incomplete type
class A<int> { }; template <> class A<int> { };
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
class ostream; class ostream;
template <class TP> class smanip;
template<class TP>
ostream& operator<<(ostream& o, const smanip<TP>& m);
template <class TP> class smanip { template <class TP> class smanip {
public: public:
friend ostream& operator<< <>(ostream &o, const smanip<TP>&m); friend ostream& operator<< <>(ostream &o, const smanip<TP>&m);
......
...@@ -6,6 +6,7 @@ template <class T> struct A { ...@@ -6,6 +6,7 @@ template <class T> struct A {
int foo () { return 1; } int foo () { return 1; }
template <>
int A<int>::t = foo (); int A<int>::t = foo ();
int main () int main ()
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
{ {
} }
template <>
class ONE<int> class ONE<int>
{ {
public: public:
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// Subject: g++ 2.5.5 doesn't warn about inaccessible virtual base ctor // Subject: g++ 2.5.5 doesn't warn about inaccessible virtual base ctor
// Message-ID: <9403030024.AA04534@ses.com> // Message-ID: <9403030024.AA04534@ses.com>
class ForceLeafSterile { class ForceLeafSterile { // ERROR -
friend class Sterile; friend class Sterile;
ForceLeafSterile() {} // ERROR - ForceLeafSterile() {} // ERROR -
}; };
......
...@@ -8,7 +8,8 @@ int main() ...@@ -8,7 +8,8 @@ int main()
{ {
int* p = (int*) malloc(sizeof(int)); int* p = (int*) malloc(sizeof(int));
(void) new (p) int(1); (void) new (p) int(1);
p->int::~int(); typedef int I;
p->I::~I();
free(p); free(p);
printf ("PASS\n"); printf ("PASS\n");
} }
...@@ -248,7 +248,7 @@ operator double() ...@@ -248,7 +248,7 @@ operator double()
{ {
assert( v.r->vec != 0 ); assert( v.r->vec != 0 );
return *v.r->vec; return *v.r->vec;
}; }
double VecElem:: double VecElem::
operator=( double d ) operator=( double d )
......
...@@ -28,7 +28,7 @@ struct var_Foo: public Foo ...@@ -28,7 +28,7 @@ struct var_Foo: public Foo
int blort(Foo& f) int blort(Foo& f)
{ {
return f->a; return f->a;
}; }
int main() int main()
{ {
......
...@@ -11,4 +11,4 @@ typedef int A[10]; ...@@ -11,4 +11,4 @@ typedef int A[10];
int main() int main()
{ {
int* a1 = new A; int* a1 = new A;
}; }
...@@ -21,7 +21,7 @@ public: ...@@ -21,7 +21,7 @@ public:
void void
sub(foo f) { sub(foo f) {
; ;
}; }
int main() { int main() {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
struct S { int a; int c; }; struct S { int a; int c; };
int i = 3; int i = 3;
S s = {6, i}; S s = {6, i};
S * the_s () { return &s; }; S * the_s () { return &s; }
int main () int main ()
{ {
S * cls = the_s (); S * cls = the_s ();
......
...@@ -120,5 +120,5 @@ public: ...@@ -120,5 +120,5 @@ public:
void Fixed_List::go_offleft() const void Fixed_List::go_offleft() const
{ {
cursor_position = 0;// ERROR - cursor_position = 0;// ERROR -
}; }
...@@ -19,7 +19,7 @@ void* new_test::operator new(size_t sz, int count, int type) ...@@ -19,7 +19,7 @@ void* new_test::operator new(size_t sz, int count, int type)
p = new char[sz * count]; p = new char[sz * count];
((new_test *)p)->type = type; ((new_test *)p)->type = type;
return p; return p;
}; }
int main() int main()
{ {
...@@ -27,4 +27,4 @@ int main() ...@@ -27,4 +27,4 @@ int main()
int count = 13; int count = 13;
test = new(count, 1) new_test; test = new(count, 1) new_test;
}; }
...@@ -4,13 +4,13 @@ extern "C" int printf( const char *, ...); ...@@ -4,13 +4,13 @@ extern "C" int printf( const char *, ...);
class B { class B {
public: public:
B() { }; B() { }
virtual ~B() { printf( "B::~B\n"); }; virtual ~B() { printf( "B::~B\n"); }
}; };
class D : public B { class D : public B {
public: public:
virtual ~D() { printf( "D::~D\n"); }; virtual ~D() { printf( "D::~D\n"); }
void operator = ( int i) { this->~B(); }// ERROR - D has no ~B part to it void operator = ( int i) { this->~B(); }// ERROR - D has no ~B part to it
}; };
...@@ -21,4 +21,4 @@ main() ...@@ -21,4 +21,4 @@ main()
B * pb = pd; B * pb = pd;
delete pb; delete pb;
return 0; return 0;
}; }
...@@ -9,7 +9,7 @@ struct S ...@@ -9,7 +9,7 @@ struct S
S* S::foo(){ S* S::foo(){
i = 0; i = 0;
return this; return this;
}; }
int S::i = 1; int S::i = 1;
int main(void) int main(void)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
struct A{ struct A{
int i; int i;
A::A():i(1){} A () :i(1){}
virtual void foo(); virtual void foo();
}a; }a;
......
...@@ -26,4 +26,4 @@ int main () { ...@@ -26,4 +26,4 @@ int main () {
return 0; return 0;
} }
return 1; return 1;
}; }
...@@ -184,4 +184,4 @@ void super::operator++(void) ...@@ -184,4 +184,4 @@ void super::operator++(void)
int main(void) int main(void)
{ {
}; }
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
class bar_2 : public foo { class bar_2 : public foo {
public: public:
bar_2(int i) : foo(i) {}; bar_2(int i) : foo(i) {}
int get_k() {return k;} int get_k() {return k;}
}; };
......
...@@ -16,4 +16,4 @@ public: ...@@ -16,4 +16,4 @@ public:
void f(B* b) { void f(B* b) {
b->setHandler(A::handlerFn); // ERROR - b->setHandler(A::handlerFn); // ERROR -
}; }
namespace N { namespace N {
int i; int i;
}; }
using namespace N; using namespace N;
......
...@@ -72,4 +72,4 @@ int main(int argc, char **argv) { ...@@ -72,4 +72,4 @@ int main(int argc, char **argv) {
Sim_Event_Manager foo; Sim_Event_Manager foo;
foo.post_event(); foo.post_event();
return fail; return fail;
}; }
...@@ -36,4 +36,4 @@ int main (int, char **) { ...@@ -36,4 +36,4 @@ int main (int, char **) {
} }
printf("PASS\n"); printf("PASS\n");
return 0; return 0;
}; }
...@@ -83,13 +83,6 @@ return_foo () ...@@ -83,13 +83,6 @@ return_foo ()
} }
foo foo
return_named_foo () return f
{
printf ("returning named foo\n");
return f;
}
foo
foo_parm_returns_foo (foo f) foo_parm_returns_foo (foo f)
{ {
return f; return f;
...@@ -133,12 +126,6 @@ warn_return_foo () ...@@ -133,12 +126,6 @@ warn_return_foo ()
} // WARNING - control reaches end } // WARNING - control reaches end
foo foo
nowarn_return_named_foo () return f
{
printf ("returning named foo\n");
}
foo
warn_foo_parm_returns_foo (foo f) warn_foo_parm_returns_foo (foo f)
{ {
f; f;
...@@ -155,7 +142,7 @@ main () ...@@ -155,7 +142,7 @@ main ()
int k = return_sum (-69, 69); int k = return_sum (-69, 69);
if (k != 0) if (k != 0)
abort_because ("wrong value returned"); abort_because ("wrong value returned");
foo f1 = return_named_foo (); foo f1 = return_foo ();
if (foo::si != 1) if (foo::si != 1)
abort_because ("wrong number of foos"); abort_because ("wrong number of foos");
f1.i = 5; f1.i = 5;
......
...@@ -249,73 +249,73 @@ inline int& operator >>=(int& a, const Int & b) ...@@ -249,73 +249,73 @@ inline int& operator >>=(int& a, const Int & b)
//# 289 "../../../../libg++/etc/benchmarks/Int.h" //# 289 "../../../../libg++/etc/benchmarks/Int.h"
inline Int operator - (const Int & a) return r(a) inline Int operator - (const Int & a) return r(a) // ERROR -
{ r.negate(); } { r.negate(); } // ERROR -
inline Int operator ~ (const Int & a) return r(a) inline Int operator ~ (const Int & a) return r(a) // ERROR -
{ r.complement(); } { r.complement(); } // ERROR -
inline Int operator + (const Int & a, const Int & b) return r(a) inline Int operator + (const Int & a, const Int & b) return r(a) // ERROR -
{ r += b.Int::val(); } { r += b.Int::val(); } // ERROR -
inline Int operator - (const Int & a, const Int & b) return r(a) inline Int operator - (const Int & a, const Int & b) return r(a) // ERROR -
{ r -= b.Int::val(); } { r -= b.Int::val(); } // ERROR -
inline Int operator * (const Int & a, const Int & b) return r(a) inline Int operator * (const Int & a, const Int & b) return r(a) // ERROR -
{ r *= b.Int::val(); } { r *= b.Int::val(); } // ERROR -
inline Int operator / (const Int & a, const Int & b) return r(a) inline Int operator / (const Int & a, const Int & b) return r(a) // ERROR -
{ r /= b.Int::val(); } { r /= b.Int::val(); } // ERROR -
inline Int operator % (const Int & a, const Int & b) return r(a) inline Int operator % (const Int & a, const Int & b) return r(a) // ERROR -
{ r %= b.Int::val(); } { r %= b.Int::val(); } // ERROR -
inline Int operator << (const Int & a, const Int & b) return r(a) inline Int operator << (const Int & a, const Int & b) return r(a) // ERROR -
{ r <<= b.Int::val(); } { r <<= b.Int::val(); } // ERROR -
inline Int operator >> (const Int & a, const Int & b) return r(a) inline Int operator >> (const Int & a, const Int & b) return r(a) // ERROR -
{ r >>= b.Int::val(); } { r >>= b.Int::val(); } // ERROR -
inline Int operator & (const Int & a, const Int & b) return r(a) inline Int operator & (const Int & a, const Int & b) return r(a) // ERROR -
{ r &= b.Int::val(); } { r &= b.Int::val(); } // ERROR -
inline Int operator | (const Int & a, const Int & b) return r(a) inline Int operator | (const Int & a, const Int & b) return r(a) // ERROR -
{ r |= b.Int::val(); } { r |= b.Int::val(); } // ERROR -
inline Int operator ^ (const Int & a, const Int & b) return r(a) inline Int operator ^ (const Int & a, const Int & b) return r(a) // ERROR -
{ r ^= b.Int::val(); } { r ^= b.Int::val(); } // ERROR -
inline Int operator + (const Int & a, const int b) return r(a) inline Int operator + (const Int & a, const int b) return r(a) // ERROR -
{ r += b; } { r += b; } // ERROR -
inline Int operator - (const Int & a, const int b) return r(a) inline Int operator - (const Int & a, const int b) return r(a) // ERROR -
{ r -= b; } { r -= b; } // ERROR -
inline Int operator * (const Int & a, const int b) return r(a) inline Int operator * (const Int & a, const int b) return r(a) // ERROR -
{ r *= b; } { r *= b; } // ERROR -
inline Int operator / (const Int & a, const int b) return r(a) inline Int operator / (const Int & a, const int b) return r(a) // ERROR -
{ r /= b; } { r /= b; } // ERROR -
inline Int operator % (const Int & a, const int b) return r(a) inline Int operator % (const Int & a, const int b) return r(a) // ERROR -
{ r %= b; } { r %= b; } // ERROR -
inline Int operator << (const Int & a, const int b) return r(a) inline Int operator << (const Int & a, const int b) return r(a) // ERROR -
{ r <<= b; } { r <<= b; } // ERROR -
inline Int operator >> (const Int & a, const int b) return r(a) inline Int operator >> (const Int & a, const int b) return r(a) // ERROR -
{ r >>= b; } { r >>= b; } // ERROR -
inline Int operator & (const Int & a, const int b) return r(a) inline Int operator & (const Int & a, const int b) return r(a) // ERROR -
{ r &= b; } { r &= b; } // ERROR -
inline Int operator | (const Int & a, const int b) return r(a) inline Int operator | (const Int & a, const int b) return r(a) // ERROR -
{ r |= b; } { r |= b; } // ERROR -
inline Int operator ^ (const Int & a, const int b) return r(a) inline Int operator ^ (const Int & a, const int b) return r(a) // ERROR -
{ r ^= b; } { r ^= b; } // ERROR -
inline Int operator + (const int a, const Int & b) return r(a) inline Int operator + (const int a, const Int & b) return r(a) // ERROR -
{ r += b.Int::val(); } { r += b.Int::val(); } // ERROR -
inline Int operator - (const int a, const Int & b) return r(a) inline Int operator - (const int a, const Int & b) return r(a) // ERROR -
{ r -= b.Int::val(); } { r -= b.Int::val(); } // ERROR -
inline Int operator * (const int a, const Int & b) return r(a) inline Int operator * (const int a, const Int & b) return r(a) // ERROR -
{ r *= b.Int::val(); } { r *= b.Int::val(); } // ERROR -
inline Int operator / (const int a, const Int & b) return r(a) inline Int operator / (const int a, const Int & b) return r(a) // ERROR -
{ r /= b.Int::val(); } { r /= b.Int::val(); } // ERROR -
inline Int operator % (const int a, const Int & b) return r(a) inline Int operator % (const int a, const Int & b) return r(a) // ERROR -
{ r %= b.Int::val(); } { r %= b.Int::val(); } // ERROR -
inline Int operator << (const int a, const Int & b) return r(a) inline Int operator << (const int a, const Int & b) return r(a) // ERROR -
{ r <<= b.Int::val(); } { r <<= b.Int::val(); } // ERROR -
inline Int operator >> (const int a, const Int & b) return r(a) inline Int operator >> (const int a, const Int & b) return r(a) // ERROR -
{ r >>= b.Int::val(); } { r >>= b.Int::val(); } // ERROR -
inline Int operator & (const int a, const Int & b) return r(a) inline Int operator & (const int a, const Int & b) return r(a) // ERROR -
{ r &= b.Int::val(); } { r &= b.Int::val(); } // ERROR -
inline Int operator | (const int a, const Int & b) return r(a) inline Int operator | (const int a, const Int & b) return r(a) // ERROR -
{ r |= b.Int::val(); } { r |= b.Int::val(); } // ERROR -
inline Int operator ^ (const int a, const Int & b) return r(a) inline Int operator ^ (const int a, const Int & b) return r(a) // ERROR -
{ r ^= b.Int::val(); } { r ^= b.Int::val(); } // ERROR -
...@@ -588,73 +588,73 @@ inline char& operator >>=(char& a, const Char & b) ...@@ -588,73 +588,73 @@ inline char& operator >>=(char& a, const Char & b)
//# 291 "../../../../libg++/etc/benchmarks/Char.h" //# 291 "../../../../libg++/etc/benchmarks/Char.h"
inline Char operator - (const Char & a) return r(a) inline Char operator - (const Char & a) return r(a) // ERROR -
{ r.negate(); } { r.negate(); } // ERROR -
inline Char operator ~ (const Char & a) return r(a) inline Char operator ~ (const Char & a) return r(a) // ERROR -
{ r.complement(); } { r.complement(); } // ERROR -
inline Char operator + (const Char & a, const Char & b) return r(a) inline Char operator + (const Char & a, const Char & b) return r(a) // ERROR -
{ r += b.Char::val(); } { r += b.Char::val(); } // ERROR -
inline Char operator - (const Char & a, const Char & b) return r(a) inline Char operator - (const Char & a, const Char & b) return r(a) // ERROR -
{ r -= b.Char::val(); } { r -= b.Char::val(); } // ERROR -
inline Char operator * (const Char & a, const Char & b) return r(a) inline Char operator * (const Char & a, const Char & b) return r(a) // ERROR -
{ r *= b.Char::val(); } { r *= b.Char::val(); } // ERROR -
inline Char operator / (const Char & a, const Char & b) return r(a) inline Char operator / (const Char & a, const Char & b) return r(a) // ERROR -
{ r /= b.Char::val(); } { r /= b.Char::val(); } // ERROR -
inline Char operator % (const Char & a, const Char & b) return r(a) inline Char operator % (const Char & a, const Char & b) return r(a) // ERROR -
{ r %= b.Char::val(); } { r %= b.Char::val(); } // ERROR -
inline Char operator << (const Char & a, const Char & b) return r(a) inline Char operator << (const Char & a, const Char & b) return r(a) // ERROR -
{ r <<= b.Char::val(); } { r <<= b.Char::val(); } // ERROR -
inline Char operator >> (const Char & a, const Char & b) return r(a) inline Char operator >> (const Char & a, const Char & b) return r(a) // ERROR -
{ r >>= b.Char::val(); } { r >>= b.Char::val(); } // ERROR -
inline Char operator & (const Char & a, const Char & b) return r(a) inline Char operator & (const Char & a, const Char & b) return r(a) // ERROR -
{ r &= b.Char::val(); } { r &= b.Char::val(); } // ERROR -
inline Char operator | (const Char & a, const Char & b) return r(a) inline Char operator | (const Char & a, const Char & b) return r(a) // ERROR -
{ r |= b.Char::val(); } { r |= b.Char::val(); } // ERROR -
inline Char operator ^ (const Char & a, const Char & b) return r(a) inline Char operator ^ (const Char & a, const Char & b) return r(a) // ERROR -
{ r ^= b.Char::val(); } { r ^= b.Char::val(); } // ERROR -
inline Char operator + (const Char & a, const char b) return r(a) inline Char operator + (const Char & a, const char b) return r(a) // ERROR -
{ r += b; } { r += b; } // ERROR -
inline Char operator - (const Char & a, const char b) return r(a) inline Char operator - (const Char & a, const char b) return r(a) // ERROR -
{ r -= b; } { r -= b; } // ERROR -
inline Char operator * (const Char & a, const char b) return r(a) inline Char operator * (const Char & a, const char b) return r(a) // ERROR -
{ r *= b; } { r *= b; } // ERROR -
inline Char operator / (const Char & a, const char b) return r(a) inline Char operator / (const Char & a, const char b) return r(a) // ERROR -
{ r /= b; } { r /= b; } // ERROR -
inline Char operator % (const Char & a, const char b) return r(a) inline Char operator % (const Char & a, const char b) return r(a) // ERROR -
{ r %= b; } { r %= b; } // ERROR -
inline Char operator << (const Char & a, const char b) return r(a) inline Char operator << (const Char & a, const char b) return r(a) // ERROR -
{ r <<= b; } { r <<= b; } // ERROR -
inline Char operator >> (const Char & a, const char b) return r(a) inline Char operator >> (const Char & a, const char b) return r(a) // ERROR -
{ r >>= b; } { r >>= b; } // ERROR -
inline Char operator & (const Char & a, const char b) return r(a) inline Char operator & (const Char & a, const char b) return r(a) // ERROR -
{ r &= b; } { r &= b; } // ERROR -
inline Char operator | (const Char & a, const char b) return r(a) inline Char operator | (const Char & a, const char b) return r(a) // ERROR -
{ r |= b; } { r |= b; } // ERROR -
inline Char operator ^ (const Char & a, const char b) return r(a) inline Char operator ^ (const Char & a, const char b) return r(a) // ERROR -
{ r ^= b; } { r ^= b; } // ERROR -
inline Char operator + (const char a, const Char & b) return r(a) inline Char operator + (const char a, const Char & b) return r(a) // ERROR -
{ r += b.Char::val(); } { r += b.Char::val(); } // ERROR -
inline Char operator - (const char a, const Char & b) return r(a) inline Char operator - (const char a, const Char & b) return r(a) // ERROR -
{ r -= b.Char::val(); } { r -= b.Char::val(); } // ERROR -
inline Char operator * (const char a, const Char & b) return r(a) inline Char operator * (const char a, const Char & b) return r(a) // ERROR -
{ r *= b.Char::val(); } { r *= b.Char::val(); } // ERROR -
inline Char operator / (const char a, const Char & b) return r(a) inline Char operator / (const char a, const Char & b) return r(a) // ERROR -
{ r /= b.Char::val(); } { r /= b.Char::val(); } // ERROR -
inline Char operator % (const char a, const Char & b) return r(a) inline Char operator % (const char a, const Char & b) return r(a) // ERROR -
{ r %= b.Char::val(); } { r %= b.Char::val(); } // ERROR -
inline Char operator << (const char a, const Char & b) return r(a) inline Char operator << (const char a, const Char & b) return r(a) // ERROR -
{ r <<= b.Char::val(); } { r <<= b.Char::val(); } // ERROR -
inline Char operator >> (const char a, const Char & b) return r(a) inline Char operator >> (const char a, const Char & b) return r(a) // ERROR -
{ r >>= b.Char::val(); } { r >>= b.Char::val(); } // ERROR -
inline Char operator & (const char a, const Char & b) return r(a) inline Char operator & (const char a, const Char & b) return r(a) // ERROR -
{ r &= b.Char::val(); } { r &= b.Char::val(); } // ERROR -
inline Char operator | (const char a, const Char & b) return r(a) inline Char operator | (const char a, const Char & b) return r(a) // ERROR -
{ r |= b.Char::val(); } { r |= b.Char::val(); } // ERROR -
inline Char operator ^ (const char a, const Char & b) return r(a) inline Char operator ^ (const char a, const Char & b) return r(a) // ERROR -
{ r ^= b.Char::val(); } { r ^= b.Char::val(); } // ERROR -
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
extern "C" extern "C"
{ {
int printf(const char *, ...); int printf(const char *, ...);
}; }
void Munge(int& x) void Munge(int& x)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
extern "C" extern "C"
{ {
int printf(const char*, ...); int printf(const char*, ...);
}; }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
//# 1 "GctSymbol.GctSymbol.CHMap.cc" //# 1 "GctSymbol.GctSymbol.CHMap.cc"
// This may look like C code, but it is really -*- C++ -*- // This may look like C code, but it is really -*- C++ -*-
/* /*
Copyright (C) 1988, 2000 Free Software Foundation Copyright (C) 1988, 2000, 2002 Free Software Foundation
written by Doug Lea (dl@rocky.oswego.edu) written by Doug Lea (dl@rocky.oswego.edu)
This file is part of the GNU C++ Library. This library is free This file is part of the GNU C++ Library. This library is free
...@@ -1602,74 +1602,74 @@ inline void String:: operator +=(char y) ...@@ -1602,74 +1602,74 @@ inline void String:: operator +=(char y)
inline String operator + (const String& x, const String& y) return r; inline String operator + (const String& x, const String& y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const String& x, const SubString& y) return r; inline String operator + (const String& x, const SubString& y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const String& x, const char* y) return r; inline String operator + (const String& x, const char* y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const String& x, char y) return r; inline String operator + (const String& x, char y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const SubString& x, const String& y) return r; inline String operator + (const SubString& x, const String& y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const SubString& x, const SubString& y) return r; inline String operator + (const SubString& x, const SubString& y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const SubString& x, const char* y) return r; inline String operator + (const SubString& x, const char* y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const SubString& x, char y) return r; inline String operator + (const SubString& x, char y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const char* x, const String& y) return r; inline String operator + (const char* x, const String& y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String operator + (const char* x, const SubString& y) return r; inline String operator + (const char* x, const SubString& y) return r; // ERROR -
{ {
cat(x, y, r); cat(x, y, r); // ERROR -
} }
inline String reverse(const String& x) return r; inline String reverse(const String& x) return r; // ERROR -
{ {
r.rep = Sreverse(x.rep, r.rep); r.rep = Sreverse(x.rep, r.rep); // ERROR -
} }
inline String upcase(const String& x) return r; inline String upcase(const String& x) return r; // ERROR -
{ {
r.rep = Supcase(x.rep, r.rep); r.rep = Supcase(x.rep, r.rep); // ERROR -
} }
inline String downcase(const String& x) return r; inline String downcase(const String& x) return r; // ERROR -
{ {
r.rep = Sdowncase(x.rep, r.rep); r.rep = Sdowncase(x.rep, r.rep); // ERROR -
} }
inline String capitalize(const String& x) return r; inline String capitalize(const String& x) return r; // ERROR -
{ {
r.rep = Scapitalize(x.rep, r.rep); r.rep = Scapitalize(x.rep, r.rep); // ERROR -
} }
//# 883 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h" //# 883 "/projects/gnu-cygnus/gnu-cygnus-8/common/g++-include/String.h"
......
...@@ -10,7 +10,7 @@ public: ...@@ -10,7 +10,7 @@ public:
template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) { template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) {
sp->dummy(cb); sp->dummy(cb);
return *sp; return *sp;
}; }
class A { class A {
public: public:
......
...@@ -13,7 +13,7 @@ private: ...@@ -13,7 +13,7 @@ private:
int Q::g() { int Q::g() {
return (kp->f)(42); return (kp->f)(42);
}; }
int main () { int main () {
......
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
namespace hei { namespace hei {
class CSomeClass {}; class CSomeClass {};
extern CSomeClass SomeClass; extern CSomeClass SomeClass;
}; }
hei::CSomeClass hei::CSomeClass; // ERROR - should be hei::SomeClass hei::CSomeClass hei::CSomeClass; // ERROR - should be hei::SomeClass - XFAIL *-*-*
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace N { namespace N {
template <class T> struct S; template <class T> struct S;
}; }
void f() void f()
{ {
......
//Build don't link: //Build don't link:
namespace x { }; namespace x { }
void f(int); void f(int);
......
...@@ -4,7 +4,7 @@ namespace foo ...@@ -4,7 +4,7 @@ namespace foo
class c class c
{ {
}; };
}; }
int int
foo::c:fn () // ERROR - syntax error foo::c:fn () // ERROR - syntax error
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
namespace N { namespace N {
template <class T> void f () { } template <class T> void f () { }
template <class T> struct A { friend void f<T>(); }; template <class T> struct A { friend void f<T>(); };
}; }
namespace M { namespace M {
struct B; struct B;
}; }
struct M::B: public N::A<int> { }; struct M::B: public N::A<int> { };
...@@ -23,7 +23,7 @@ int main() ...@@ -23,7 +23,7 @@ int main()
X::Y<int> z; X::Y<int> z;
if (z.f(4) != 1) if (z.f(4) != 1)
return 1; return 1;
z.template g<long>(); z.g<long>();
Y<int> z1; Y<int> z1;
if (z1.f(5) != 2) if (z1.f(5) != 2)
......
...@@ -15,7 +15,7 @@ namespace A { ...@@ -15,7 +15,7 @@ namespace A {
template <> template <>
const unsigned B<int,int>::count = 2; // ERROR - duplicate init const unsigned B<int,int>::count = 2; // ERROR - duplicate init
} }
}; }
int int
main() main()
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
// Build don't link: // Build don't link:
namespace standard namespace standard
{ void print(int) {}; { void print(int) {}
void dump(int) {}; void dump(int) {}
} }
namespace A { using standard::print; } namespace A { using standard::print; }
namespace B { using namespace standard; } namespace B { using namespace standard; }
......
// Build don't link: // Build don't link:
// Copyright (C) 1999, 2000 Free Software Foundation // Copyright (C) 1999, 2000, 2002 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br> // by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// Special g++ Options: -Wno-deprecated // Special g++ Options: -Wno-deprecated
inline int bar () return r {} inline int bar () return r {} // ERROR -
int foo () { int foo () {
return bar (); return bar ();
......
// Build don't link: // Build don't link:
// Copyright (C) 1999, 2000 Free Software Foundation // Copyright (C) 1999, 2000, 2002 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br> // by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// Special g++ Options: -O1 -Wno-deprecated // Special g++ Options: -O1 -Wno-deprecated
inline int bar () return r {} inline int bar () return r {} // ERROR -
int& foo (int& x) { int& foo (int& x) {
bar (); bar ();
......
// Build don't link: // Build don't link:
struct A { struct A { // ERROR - inaccessible
static int i; static int i;
}; };
struct B : private A { }; struct B : private A { };
struct C : public B { struct C : public B {
int f () { return A::i; } int f () { return A::i; } // ERROR - context
}; };
...@@ -5,16 +5,16 @@ int count = 0; ...@@ -5,16 +5,16 @@ int count = 0;
double foo () { double foo () {
count++; count++;
return 0; return 0;
}; }
double bar () { double bar () {
const double x[1] = { foo() }; const double x[1] = { foo() };
return x[0]; return x[0];
}; }
int main () int main ()
{ {
bar(); bar();
if (count != 1) if (count != 1)
return 1; return 1;
}; }
class A class A
{ {
enum B { ONE, TWO, THREE }; enum B { ONE, TWO, THREE }; // ERROR - private
}; };
class A::B; // ERROR - A::B is not a class type class A::B; // ERROR - A::B is not a class type, context
...@@ -18,4 +18,4 @@ struct string ...@@ -18,4 +18,4 @@ struct string
max_size() const { return size; } max_size() const { return size; }
}; };
template string <char>; template struct string <char>;
...@@ -11,6 +11,6 @@ X::x() ...@@ -11,6 +11,6 @@ X::x()
{ // ERROR - { // ERROR -
} }
X::~x() X::~x() // ERROR -
{ // ERROR - {
} }
...@@ -4,4 +4,4 @@ struct T { ...@@ -4,4 +4,4 @@ struct T {
struct S __attribute__ ((packed)) { // ERROR - parse error struct S __attribute__ ((packed)) { // ERROR - parse error
int i; int i;
}; };
}; // ERROR - parse error };
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
namespace std { namespace std {
const int __stl_chunk_size = 7; const int __stl_chunk_size = 7;
}; }
int main () int main ()
{ {
......
// Build don't link: // Build don't link:
// Copyright (C) 1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 22 Apr 1999 <nathan@acm.org> // Contributed by Nathan Sidwell 22 Apr 1999 <nathan@acm.org>
// derived from a bug report by <rch@larissa.sd.bi.ruhr-uni-bochum.de> // derived from a bug report by <rch@larissa.sd.bi.ruhr-uni-bochum.de>
// http://gcc.gnu.org/ml/gcc-bugs/1999-04n/msg00631.html // http://gcc.gnu.org/ml/gcc-bugs/1999-04n/msg00631.html
...@@ -26,12 +26,12 @@ struct B { ...@@ -26,12 +26,12 @@ struct B {
struct A::fink { // ERROR - no such member struct A::fink { // ERROR - no such member
int m; int m;
}; };
struct A::Z { // ERROR XFAIL - A::Z not a member of B struct A::Z { // ERROR - A::Z not a member of B XFAIL
int m; int m;
}; };
int m; int m;
int n; int n;
struct ::Q { // ERROR XFAIL - ::Q not a member of B struct ::Q { // ERROR - ::Q not a member of B XFAIL
int m; int m;
}; };
int A::fn() { // ERROR - A::fn not a member of B int A::fn() { // ERROR - A::fn not a member of B
...@@ -66,7 +66,7 @@ namespace NMS ...@@ -66,7 +66,7 @@ namespace NMS
int N::fn() { // ERROR - N::fn not a member of NMS int N::fn() { // ERROR - N::fn not a member of NMS
return 0; return 0;
} }
struct N::F { // ERROR XFAIL - N::F not a member of NMS struct N::F { // ERROR - N::F not a member of NMS XFAIL
int i; int i;
}; };
} }
......
// Build don't link: // Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 7 Jan 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 7 Jan 2001 <nathan@codesourcery.com>
// As of G++ 3.4, we no longer attempt to detect dependencies; the
// standard does not require that we do.
// Bug 1038. Default args on class members can produce circular dependencies. // Bug 1038. Default args on class members can produce circular dependencies.
// Make sure we spot them, and don't depend on a particular ordering. // Make sure we spot them, and don't depend on a particular ordering.
struct A struct A
{ {
static int Foo (int = Baz ()); // WARNING - circular static int Foo (int = Baz ()); // ERROR -
static int Baz (int = Foo ()); // WARNING - circular static int Baz (int = Foo ());
}; };
struct Test struct Test
...@@ -21,7 +24,7 @@ struct Test ...@@ -21,7 +24,7 @@ struct Test
struct B struct B
{ {
static int Bar (int = Foo (1)); static int Bar (int = Foo (1));
static int Foo (int = Baz ()); static int Foo (int = Baz ()); // ERROR -
static int Baz (int = Foo (1)); static int Baz (int = Foo (1));
}; };
......
// Build don't link: // Build don't link:
// Special g++ options: -pedantic-errors -ansi -w // Special g++ options: -pedantic-errors -ansi -w
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 7 Jan 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 7 Jan 2001 <nathan@codesourcery.com>
// As of G++ 3.4, we no longer attempt to detect dependencies; the
// standard does not require that we do.
// Bug 1038. Default args on class members can produce circular dependencies. // Bug 1038. Default args on class members can produce circular dependencies.
// Make sure we spot them, and don't depend on a particular ordering. // Make sure we spot them, and don't depend on a particular ordering.
struct AA struct AA
{ {
static int Foo (int = Baz ()); // ERROR - candidate static int Foo (int = Baz ()); // ERROR - not yet been parsed
static int Baz (int = Foo ()); // ERROR - candidate static int Baz (int = Foo ());
}; };
int main () int main ()
{ {
AA::Foo (); // ERROR - no candidate AA::Foo ();
AA::Foo (1); AA::Foo (1);
AA::Baz (); // ERROR - no candidate AA::Baz ();
AA::Baz (1); AA::Baz (1);
return 0; return 0;
......
...@@ -14,4 +14,4 @@ main () ...@@ -14,4 +14,4 @@ main ()
{ {
X* p = new (bar) X; X* p = new (bar) X;
p->~foo(); p->~foo();
}; }
...@@ -31,7 +31,7 @@ T f () { ...@@ -31,7 +31,7 @@ T f () {
} }
void g (S) { void g (S) {
}; }
int main () int main ()
{ {
......
...@@ -8,8 +8,8 @@ struct S; // ERROR - forward ref ...@@ -8,8 +8,8 @@ struct S; // ERROR - forward ref
void f(S); // ok void f(S); // ok
void f(S s) {} // ERROR - incomplete type void f(S s) {} // ERROR - incomplete type
void j (int){}; // ok void j (int){} // ok
void k (){}; // ok void k (){} // ok
void q (void){} // ok void q (void){} // ok
void t (void t); // ERROR - incomplete void t (void t); // ERROR - incomplete
void r (void, ...); // ERROR - incomplete void r (void, ...); // ERROR - incomplete
......
...@@ -7,7 +7,7 @@ namespace N { ...@@ -7,7 +7,7 @@ namespace N {
void f () { void f () {
i = 3; i = 3;
} }
}; }
int i; int i;
......
...@@ -6,10 +6,10 @@ typedef int B; ...@@ -6,10 +6,10 @@ typedef int B;
struct A struct A
{ {
int B; int B;
operator B *(); operator B *(); // ERROR -
}; };
A::operator B * () A::operator B * () // ERROR -
{ {
return 0; return 0;
} }
...@@ -48,7 +48,7 @@ struct G ...@@ -48,7 +48,7 @@ struct G
}; };
typedef double H; typedef double H;
G::operator H * () // ERROR - mismatch G::operator H * ()
{ {
return 0; return 0;
} }
...@@ -13,7 +13,7 @@ inline bool operator!=(const c& x, const c& y) ...@@ -13,7 +13,7 @@ inline bool operator!=(const c& x, const c& y)
{ {
return x.a != y.a; return x.a != y.a;
} }
}; }
void foo(); void foo();
......
// Build don't link: // Build don't link:
// //
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 10 Aug 2000 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 10 Aug 2000 <nathan@codesourcery.com>
// bug 381. We gave slightly different diagnostics, when binding an rvalue to // bug 381. We gave slightly different diagnostics, when binding an rvalue to
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
namespace A { namespace A {
template <class T> void f(T) {} template <class T> void f(T) {}
}; }
void (* &h)(int) = A::f<int>; // ERROR - rvalue to non-const void (* &h)(int) = A::f<int>; // ERROR - rvalue to non-const
void (*const volatile &i)(int) = A::f<int>; // ERROR - rvalue to volatile void (*const volatile &i)(int) = A::f<int>; // ERROR - rvalue to volatile
void (*const &j)(int) = A::f<int>; void (*const &j)(int) = A::f<int>;
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
struct S struct S
{ {
int j; // ERROR - member int j; // ERROR - non-static data member
int i[2]; // ERROR - member int i[2]; // ERROR - non-static data member
}; };
void f () void f ()
{ {
sizeof (S::j); // ERROR - non-static data member sizeof (S::j); // ERROR - used here
sizeof (S::i[0]); // ERROR - non-static data member sizeof (S::i[0]); // ERROR - used here
} }
...@@ -9,4 +9,4 @@ namespace std { ...@@ -9,4 +9,4 @@ namespace std {
void f () { void f () {
memcmp (0, 0, 0); memcmp (0, 0, 0);
} }
}; }
...@@ -11,4 +11,4 @@ void f(unsigned int n) { ...@@ -11,4 +11,4 @@ void f(unsigned int n) {
int x[n]; int x[n];
asize(x); // ERROR - no matching function asize(x); // ERROR - no matching function
}; }
...@@ -50,6 +50,7 @@ public: ...@@ -50,6 +50,7 @@ public:
: MetaClassGeneric( TypeIDInit<T>::info ) {} : MetaClassGeneric( TypeIDInit<T>::info ) {}
}; };
template <>
class MetaClass<UUId> class MetaClass<UUId>
: public NameInfo<UUId> : public NameInfo<UUId>
{ {
......
...@@ -8,6 +8,6 @@ template <class T> struct A ...@@ -8,6 +8,6 @@ template <class T> struct A
template<class T> struct C template<class T> struct C
{ {
friend typename A<T>::B; // ERROR - struct is required friend typename A<T>::B; // ERROR - `typename' not allowed
}; };
...@@ -7,7 +7,7 @@ struct S { ...@@ -7,7 +7,7 @@ struct S {
struct Y {}; struct Y {};
template <int U> template <int U>
friend struct S<U>::X; // ERROR - typename as friend friend struct S<U>::X;
template <int U> template <int U>
friend typename S<U>::Y; // ERROR - typename as friend friend typename S<U>::Y; // ERROR - typename as friend
...@@ -15,7 +15,7 @@ struct S { ...@@ -15,7 +15,7 @@ struct S {
struct T { struct T {
template <int T> template <int T>
friend struct S<T>::X; // ERROR - typename as friend friend struct S<T>::X;
}; };
struct U { struct U {
......
// Build don't link: // Build don't link:
// //
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 5 Sept 2000 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 5 Sept 2000 <nathan@codesourcery.com>
// bug 147. We ICE'd on an unprocessed LOOKUP_EXPR during tsubsting // bug 147. We ICE'd on an unprocessed LOOKUP_EXPR during tsubsting
namespace EManip { namespace EManip {
template <class T> void do_assign(T* d); // ERROR - candidate template <class T> void do_assign(T* d); // ERROR - candidate
}; }
template <class T> void do_assign(T* d); // ERROR - candidate template <class T> void do_assign(T* d); // ERROR - candidate
template <class T> template <class T>
......
// Build don't link: // Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 11 Jan 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 11 Jan 2001 <nathan@codesourcery.com>
// Bug 1506. We ICE'd on a struct definition inside a template parms. // Bug 1506. We ICE'd on a struct definition inside a template parms.
...@@ -10,3 +10,4 @@ ...@@ -10,3 +10,4 @@
template<class T = template<class T =
struct W {}; // ERROR - inside template parms struct W {}; // ERROR - inside template parms
> struct S{};
...@@ -21,4 +21,4 @@ template <> ...@@ -21,4 +21,4 @@ template <>
void bar<2>::foo (Point<2> p) { void bar<2>::foo (Point<2> p) {
const int dim = 2; const int dim = 2;
Point<dim> q = p; Point<dim> q = p;
}; }
...@@ -8,7 +8,7 @@ template <class T, class U> class foo2; ...@@ -8,7 +8,7 @@ template <class T, class U> class foo2;
struct bar { struct bar {
template <class T, class U> template <class T, class U>
bar(int i = foo1<T>::baz, // ok bar(int i = foo1<T>::baz, // gets bogus error - XFAIL *-*-*
int j = int(foo2<T, U>::baz), // ok int j = int(foo2<T, U>::baz), // ok
int k = foo2<T, U>::baz) {} // gets bogus error - before > - XFAIL *-*-* int k = foo2<T, U>::baz) {} // gets bogus error - before > - XFAIL *-*-*
}; };
...@@ -15,8 +15,8 @@ public: ...@@ -15,8 +15,8 @@ public:
void sz(X s) { sss = s; } void sz(X s) { sss = s; }
}; };
float TC<float>::sss; template <> float TC<float>::sss = 0.0;
long TC<long>::sss; template <> long TC<long>::sss = 0;
TC<long> xjj(1,2); TC<long> xjj(1,2);
......
...@@ -8,8 +8,8 @@ public: ...@@ -8,8 +8,8 @@ public:
}; };
long TC<long>::sss; template <> long TC<long>::sss = 0;
float TC<float>::sss; template <> float TC<float>::sss = 0.0;
TC<long> xjj(1,2); TC<long> xjj(1,2);
......
...@@ -8,8 +8,8 @@ public: ...@@ -8,8 +8,8 @@ public:
void syy(X syarg) { sss = syarg; } void syy(X syarg) { sss = syarg; }
}; };
long TC<long>::sss; template <> long TC<long>::sss = 0;
float TC<float>::sss; template <> float TC<float>::sss = 0.0;
TC<long> xjj(1,2); TC<long> xjj(1,2);
......
...@@ -8,7 +8,7 @@ int f() ...@@ -8,7 +8,7 @@ int f()
E e; E e;
e = a; e = a;
return (int) e; return (int) e;
}; }
}; };
S s; S s;
......
...@@ -16,5 +16,5 @@ void S<char*>::foo<int>(int) {} ...@@ -16,5 +16,5 @@ void S<char*>::foo<int>(int) {}
int main() int main()
{ {
S<char*> s; S<char*> s;
s.template foo<int>(3.0); s.foo<int>(3.0);
} }
...@@ -11,7 +11,7 @@ struct S ...@@ -11,7 +11,7 @@ struct S
int main() int main()
{ {
double d = S<int>::template foo<char>(3.3); double d = S<int>::foo<char>(3.3);
return (d >= 3.1); return (d >= 3.1);
} }
...@@ -4,6 +4,6 @@ template <class T> ...@@ -4,6 +4,6 @@ template <class T>
void foo(T t); void foo(T t);
template <> template <>
void foo(int) {}; void foo(int) {}
void foo(int) {} void foo(int) {}
...@@ -13,5 +13,5 @@ void S::foo<int>(int i) { } ...@@ -13,5 +13,5 @@ void S::foo<int>(int i) { }
int main() int main()
{ {
S s; S s;
s.template foo<int>(3.0); s.foo<int>(3.0);
} }
...@@ -12,4 +12,4 @@ class bug { ...@@ -12,4 +12,4 @@ class bug {
}; };
template <class X> template <class X>
template <> // ERROR - invalid specialization template <> // ERROR - invalid specialization
class bug<X>::a<char> {}; // ERROR - "" class bug<X>::a<char> {};
...@@ -10,7 +10,7 @@ struct A ...@@ -10,7 +10,7 @@ struct A
class B; class B;
}; };
class A<int>::B { }; template <> class A<int>::B { };
template class A<int>; template class A<int>;
template class A<double>; template class A<double>;
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
class mystream; class mystream;
template <class T> class a;
template <class T> mystream& operator>>( mystream& s, a<T>& thea );
template <class T> class a { template <class T> class a {
public: public:
friend mystream& operator>> <>( mystream&, a<T>& thea ); friend mystream& operator>> <>( mystream&, a<T>& thea );
...@@ -9,8 +13,6 @@ private: ...@@ -9,8 +13,6 @@ private:
T amember; T amember;
}; };
template <class T> mystream& operator>>( mystream& s, a<T>& thea );
template<> mystream& operator>> <int>( mystream& s, a<int>& thea ); template<> mystream& operator>> <int>( mystream& s, a<int>& thea );
template class a<int>; template class a<int>;
......
// Build don't link: // Build don't link:
template <class T> class a;
template <class T> void foo( a<T>& thea );
template <class T> class a { template <class T> class a {
public: public:
friend void foo<>( a<T>& thea ); friend void foo<>( a<T>& thea );
......
// Build don't link: // Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 17 Nov 2000 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 17 Nov 2000 <nathan@codesourcery.com>
// bug 43. Two failings, bison parser ickiness caused us to find the member // bug 43. Two failings, bison parser ickiness caused us to find the member
...@@ -17,7 +17,7 @@ namespace X { ...@@ -17,7 +17,7 @@ namespace X {
V (const T&); V (const T&);
void operator- (); void operator- ();
friend void operator-<> (const P<T>& a); friend void X::operator-<> (const P<T>& a);
}; };
} }
......
...@@ -14,4 +14,4 @@ class D { ...@@ -14,4 +14,4 @@ class D {
template <class U> template <class U>
friend class N::D; friend class N::D;
}; };
}; }
...@@ -16,7 +16,7 @@ struct S ...@@ -16,7 +16,7 @@ struct S
}; };
template S<char>; template struct S<char>;
template void S<int>::bar(int); template void S<int>::bar(int);
template void S<double>::baz<short>(short); template void S<double>::baz<short>(short);
template void S<long>::baz<>(char); template void S<long>::baz<>(char);
...@@ -15,7 +15,7 @@ public: ...@@ -15,7 +15,7 @@ public:
vect<t>& operator=( const vect<t>& v ); vect<t>& operator=( const vect<t>& v );
vect<t> operator-( void ) const; vect<t> operator-( void ) const;
friend vect<t> operator- <>( const vect<t>&, const vect<t>& ); friend vect<t> (::operator- <>)( const vect<t>&, const vect<t>& );
private: private:
t a_; t a_;
......
// Build don't link: // Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com>
// bug 616. We failed to complete the type of decls in templates, leading to // bug 616. We failed to complete the type of decls in templates, leading to
...@@ -35,6 +35,6 @@ void f() ...@@ -35,6 +35,6 @@ void f()
const X<dim+1> y[3]; const X<dim+1> y[3];
Z z2; // ERROR - incomplete Z z2; // ERROR - incomplete
typedef Z z3; // ok typedef Z z3; // ok
}; }
template void f<3> (); template void f<3> ();
...@@ -14,7 +14,7 @@ struct A { ...@@ -14,7 +14,7 @@ struct A {
template <typename T1> template <typename T1>
struct B { struct B {
A<T1>::C<int> s1; typename A<T1>::template C<int> s1;
}; };
int main() int main()
......
...@@ -12,7 +12,7 @@ struct S<int, X> { ...@@ -12,7 +12,7 @@ struct S<int, X> {
template <class T> template <class T>
void f() { void f() {
typename S<T, T>::I<T> si; typename S<T, T>::template I<T> si;
} }
template void f<int>(); template void f<int>();
...@@ -9,7 +9,7 @@ template <class T, class U> ...@@ -9,7 +9,7 @@ template <class T, class U>
void f () void f ()
{ {
A<T>::template B<U>::template f<T> (); A<T>::template B<U>::template f<T> ();
typename A<T>::B<U> b; typename A<T>::template B<U> b;
typename A<T>::template B<U> b2; typename A<T>::template B<U> b2;
b.A<T>::template B<U>::~B(); b.A<T>::template B<U>::~B();
} }
......
...@@ -15,5 +15,5 @@ void S::Y<char>::foo<int>(int i) { } ...@@ -15,5 +15,5 @@ void S::Y<char>::foo<int>(int i) { }
int main() int main()
{ {
S::Y<char> s; S::Y<char> s;
s.template foo<int>(3.0); s.foo<int>(3.0);
} }
...@@ -21,5 +21,5 @@ int ...@@ -21,5 +21,5 @@ int
main() main()
{ {
bar<int> b; bar<int> b;
b.template doit<print>(2); b.doit<print>(2);
} }
...@@ -7,7 +7,7 @@ int k; ...@@ -7,7 +7,7 @@ int k;
template <int j> int f() const { return this->f<j-1>(); } template <int j> int f() const { return this->f<j-1>(); }
int g() const { return f<i>(); }; int g() const { return f<i>(); }
}; };
template <> template <>
......
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
// crash test - XFAIL *-*-* // crash test - XFAIL *-*-*
// by Paul Burchard <burchard@pobox.com>, Level Set Systems, Inc. // by Paul Burchard <burchard@pobox.com>, Level Set Systems, Inc.
// Copyright (C) 1999 Free Software Foundation // Copyright (C) 1999, 2002 Free Software Foundation
class Q { class Q {
public:
template<class> template<class>
class X { class X {
}; };
......
// Test that .template limits overload resolution to member templates.
// Note that the standard doesn't seem to require this behavior, but
// EDG works this way.
struct A { struct A {
template <class T> int f (T) { return 0; } template <class T> int f (T) { return 0; }
int f (int) { return 1; } int f (int) { return 1; }
...@@ -11,5 +6,5 @@ struct A { ...@@ -11,5 +6,5 @@ struct A {
int main () int main ()
{ {
A a; A a;
return a.template f (0); // gets bogus error XFAIL *-*-* return a.template f (0); // ERROR -
} }
...@@ -20,11 +20,11 @@ struct Ethel { ...@@ -20,11 +20,11 @@ struct Ethel {
struct Fred { struct Fred {
template <class Q, class LA, class LB> template <class Q, class LA, class LB>
Ethel<typename Q::Sig<typename LA::WrappedType>::Third> baz (); Ethel<typename Q::template Sig<typename LA::WrappedType>::Third> baz ();
template <class Z, class A, class B> template <class Z, class A, class B>
Ethel<typename Z::Sig<A>::Third> Ethel<typename Z::template Sig<A>::Third>
foo ( const Z&, const Ethel<A>&, const Ethel<B>&) const; foo ( const Z&, const Ethel<A>&, const Ethel<B>&) const;
}; };
......
...@@ -10,7 +10,7 @@ main() ...@@ -10,7 +10,7 @@ main()
{ {
foo f; foo f;
int (foo::*s)() = &foo::template bar<int>; int (foo::*s)() = &foo::bar<int>;
if ((f.*s)() == 7) if ((f.*s)() == 7)
return 0; return 0;
else else
......
...@@ -19,9 +19,9 @@ int main() ...@@ -19,9 +19,9 @@ int main()
{ {
S<double> s; S<double> s;
if (s.template f<7>(3) != 10) if (s.f<7>(3) != 10)
abort(); abort();
if (s.template f<8>(3) != 11) if (s.f<8>(3) != 11)
abort(); abort();
} }
// Build don't link: // Build don't link:
template <class T>
bool f(T);
template <class T> template <class T>
struct S1 { struct S1 {
typedef T X; typedef T X;
...@@ -16,9 +19,6 @@ struct S2<S1<T> > { ...@@ -16,9 +19,6 @@ struct S2<S1<T> > {
}; };
template <class T> template <class T>
bool f(T);
template <class T>
typename S2<S1<T> >::Y typename S2<S1<T> >::Y
f(const S1<T>&); f(const S1<T>&);
......
// Build don't link: // Build don't link:
template <class A> class B { public: A a; B(); }; template <class A> class B { public: A a; B(); };
class B<char> { public: int y[10]; }; template <> class B<char> { public: int y[10]; };
static B<int> bi; static B<int> bi;
static B<char> bc; static B<char> bc;
...@@ -7,7 +7,7 @@ template <class X> struct A { ...@@ -7,7 +7,7 @@ template <class X> struct A {
inline int z () { return 5; } inline int z () { return 5; }
}; };
template <class Y> int A<Y>::fooo (int t) { return (this->*(x?&A<Y>::y : &A<Y>::z))() + t; }; // gets bogus error template <class Y> int A<Y>::fooo (int t) { return (this->*(x?&A<Y>::y : &A<Y>::z))() + t; } // gets bogus error
A<int> ai; A<int> ai;
......
// Build don't link: // Build don't link:
template <class X> struct A { }; template <class X> struct A { };
struct A<int> { int foo (); }; template <> struct A<int> { int foo (); };
int A<int>::foo () { return 37; } int A<int>::foo () { return 37; }
...@@ -13,7 +13,7 @@ template<template<class> class D,class E> int f() ...@@ -13,7 +13,7 @@ template<template<class> class D,class E> int f()
{ {
D<E> d; D<E> d;
return d.f(); return d.f();
}; }
int main() int main()
{ {
......
...@@ -18,7 +18,7 @@ template <class X> struct D { }; ...@@ -18,7 +18,7 @@ template <class X> struct D { };
template <class T> template <class T>
bool is_C (const T&) { bool is_C (const T&) {
return is_instance_of<C,T>::answer; return is_instance_of<C,T>::answer;
}; }
int main() { int main() {
if (!is_C(C<int>())) if (!is_C(C<int>()))
......
...@@ -7,40 +7,40 @@ ...@@ -7,40 +7,40 @@
template <class T> class A2 { template <class T> class A2 {
public: public:
A2() {}; A2() {}
virtual ~A2() {}; virtual ~A2() {}
template <class other> A2 & operator=(const A2<other> o) { template <class other> A2 & operator=(const A2<other> o) {
i=o.i; i=o.i;
return *this; return *this;
}; }
T i; T i;
T j; T j;
}; };
template <class T> class A1 { template <class T> class A1 {
public: public:
A1() {}; A1() {}
virtual ~A1() {}; virtual ~A1() {}
template <class other> A1 & operator=(const A1<other> o) { template <class other> A1 & operator=(const A1<other> o) {
i=o.i; i=o.i;
return *this; return *this;
}; }
template <class other> A1 & operator=(const A2<other> o) { template <class other> A1 & operator=(const A2<other> o) {
i=o.i; i=o.i;
return *this; return *this;
}; }
T i; T i;
}; };
template <template <class U> class T> class B { template <template <class U> class T> class B {
public: public:
B(){}; B(){}
virtual ~B(){}; virtual ~B(){}
template <template <class U2> class O> struct rebind { typedef B<O> other ;}; template <template <class U2> class O> struct rebind { typedef B<O> other ;};
template <template <class U2> class O> B & operator=(const B<O> o) { template <template <class U2> class O> B & operator=(const B<O> o) {
i=o.i; i=o.i;
return *this; return *this;
}; }
T<int> i; T<int> i;
}; };
......
// Build don't link: // Build don't link:
// Special g++ Options: -Wno-deprecated
template <class T, int I> template <class T, int I>
struct S { struct S {
...@@ -7,9 +6,9 @@ struct S { ...@@ -7,9 +6,9 @@ struct S {
}; };
template <class T, class U, int I> template <class T, class U, int I>
S<T,I>::X f(T, U) { // WARNING - implicit typename typename S<T,I>::X f(T, U) {
S<T, I>::X(); typename S<T, I>::X();
return S<T, I>::X(); return typename S<T, I>::X();
} }
template S<int, 3>::X f<int, double, 3>(int, double); template S<int, 3>::X f<int, double, 3>(int, double);
...@@ -12,7 +12,7 @@ struct S : public R <T, B> { ...@@ -12,7 +12,7 @@ struct S : public R <T, B> {
template <class T> void f() template <class T> void f()
{ {
S<T>::X(); typename S<T>::X();
} }
template void f<int>(); template void f<int>();
...@@ -14,4 +14,4 @@ struct S { ...@@ -14,4 +14,4 @@ struct S {
template <class T> template <class T>
template <class U> template <class U>
typename S<T>::I<U>::X S<T>::I<U>::f() {} typename S<T>::template I<U>::X S<T>::I<U>::f() {}
// We don't try to make implicit typename handle this case.
// Build don't link: // Build don't link:
// Special g++ Options:
template <class T> template <class T>
struct A struct A
...@@ -13,10 +10,10 @@ struct A ...@@ -13,10 +10,10 @@ struct A
template <class U> template <class U>
struct B : public A<U> struct B : public A<U>
{ {
A_Type Func(); // ERROR - candidate A_Type Func(); // ERROR - declaration
}; };
template <class U> template <class U>
A<U>::A_Type B<U>::Func() A<U>::A_Type B<U>::Func() // ERROR - function
{ // ERROR - no match {
} }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 26 Feb 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 26 Feb 2001 <nathan@codesourcery.com>
// Bug 1981. using declarations in namespace scope were not remembered. // Bug 1981. using declarations in namespace scope were not remembered.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace A namespace A
{ {
void swap () {} void swap () {}
}; }
template <class T> void f() template <class T> void f()
{ {
...@@ -28,7 +28,7 @@ namespace B ...@@ -28,7 +28,7 @@ namespace B
return foo (1); return foo (1);
} }
template int baz<float> (); template int baz<float> ();
}; }
int main () int main ()
{ {
......
...@@ -14,7 +14,7 @@ struct D : public B<T> { ...@@ -14,7 +14,7 @@ struct D : public B<T> {
void g() { void g() {
B<int>* bi = new D<int>; B<int>* bi = new D<int>;
}; }
template <class T> template <class T>
void B<T>::f() {} void B<T>::f() {}
......
...@@ -16,6 +16,7 @@ A<T>::test(){ ...@@ -16,6 +16,7 @@ A<T>::test(){
std::cerr << "test for " << typeid(*this).name() << std::endl; std::cerr << "test for " << typeid(*this).name() << std::endl;
} }
// Specialization declaration // Specialization declaration
template <>
void void
A<double>::test(); A<double>::test();
......
...@@ -28,8 +28,8 @@ class test ...@@ -28,8 +28,8 @@ class test
// named return value version // named return value version
template <class T> template <class T>
test<T> operator + (const test<T>& a, const test<T>& b) return c(a); test<T> operator + (const test<T>& a, const test<T>& b) return c(a);// ERROR - named return value
{ c += b; }; { c += b; } // ERROR - c undeclared
int main() int main()
{ {
......
...@@ -17,7 +17,7 @@ public : ...@@ -17,7 +17,7 @@ public :
}; };
template <class T > template <class T >
inline bool compare(const Expr<T> a, const Expr<T> b){ return true; }; inline bool compare(const Expr<T> a, const Expr<T> b){ return true; }
int main() int main()
{ {
......
...@@ -19,7 +19,7 @@ int main() ...@@ -19,7 +19,7 @@ int main()
double d = 1234.5678; double d = 1234.5678;
cout.precision(12); cout.precision(12);
cout << max(d, i) << endl; // #1 cout << max(d, i) << endl; // ERROR -
cout << max(i, d) << endl; // #2 cout << max(i, d) << endl; // ERROR -
return 0; return 0;
} }
#include <stdio.h> #include <stdio.h>
template <int n1> template <int n1>
double val <int> () double val <int> () // ERROR - bogus code
{ // ERROR - bogus code {
return (double) n1; return (double) n1;
}; }
int main () int main ()
{ {
printf ("%d\n", val<(int)3> ()); printf ("%d\n", val<(int)3> ()); // ERROR - val undeclared
} }
// Build don't link: // Build don't link:
template <class T> void foo ();
template <class T> template <class T>
class Q { class Q {
friend void foo<T> (); friend void foo<T> ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment