Commit 2f69c594 by Giovanni Bajo

re PR c++/14008 (Confusing diagnostic when omitting a template parameter)

	PR c++/14008
	* g++.dg/parse/error15.C: New test.
	* g++.dg/parse/crash11.C: Update dg-error mark.

From-SVN: r77324
parent 2097b5f2
2003-02-05 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/14008
* g++.dg/parse/error15.C: New test.
* g++.dg/parse/crash11.C: Update dg-error mark.
2004-02-04 Mark Mitchell <mark@codesourcery.com>
PR c++/13932
......
......@@ -30,5 +30,5 @@ struct C
};
int main()
{
typedef B<C>::Template<void>::Type Type; // { dg-error "init-declarator|;" }
typedef B<C>::Template<void>::Type Type; // { dg-error "does not name a type" }
}
// { dg-do compile }
// Contributed by Volker Reichelt <reichelt at gcc dot gnu dot org>
// PR c++/14008: Improve diagnostic on invalid types in declarators.
namespace N
{
template<int> struct A {};
struct C {};
int K;
}
N::A f2; // { dg-error "without an argument list" }
N::INVALID f3; // { dg-error "in namespace `N' does not name a type" }
N::C::INVALID f4; // { dg-error "in class `N::C' does not name a type" }
N::K f6; // { dg-error "in namespace `N' does not name a type" }
typename N::A f7; // { dg-error "without an argument list|outside of template" }
struct B
{
N::A f2; // { dg-error "without an argument list" }
N::INVALID f3; // { dg-error "in namespace `N' does not name a type" }
N::C::INVALID f4; // { dg-error "in class `N::C' does not name a type" }
N::K f6; // { dg-error "in namespace `N' does not name a type" }
typename N::A f7; // { dg-error "without an argument list|outside of template" }
};
template <int>
struct C
{
N::A f2; // { dg-error "without an argument list" }
N::INVALID f3; // { dg-error "in namespace `N' does not name a type" }
N::C::INVALID f4; // { dg-error "in class `N::C' does not name a type" }
N::K f6; // { dg-error "in namespace `N' does not name a type" }
typename N::A f7; // { dg-error "without an argument list" }
};
// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 16 }
// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 24 }
// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 34 }
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