Commit 9febc4e8 by Giovanni Bajo

re PR c++/13957 (Insufficient diagnostic for dependent expression parsed as…

re PR c++/13957 (Insufficient diagnostic for dependent expression parsed as non-type but instantiated as type)

	PR c++/13957
	* g++.dg/template/non-type-template-argument-1.C,
	g++.dg/template/qualified-id1.C: Update	dg-error marks.
	* g++.dg/template/nontype6.C: New test.

From-SVN: r77091
parent 84b683c1
2004-02-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/13957
* g++.dg/template/non-type-template-argument-1.C,
g++.dg/template/qualified-id1.C: Update dg-error marks.
* g++.dg/template/nontype6.C: New test.
2004-02-01 Roger Sayle <roger@eyesopen.com> 2004-02-01 Roger Sayle <roger@eyesopen.com>
* gcc.dg/builtins-1.c: Also test for __builtin_signbit{,f,l}. * gcc.dg/builtins-1.c: Also test for __builtin_signbit{,f,l}.
......
...@@ -6,7 +6,7 @@ template <bool> struct C {}; ...@@ -6,7 +6,7 @@ template <bool> struct C {};
template <typename T> struct D template <typename T> struct D
{ {
C<T::X> c; // { dg-error "names a type" } C<T::X> c; // { dg-error "parsed as a non-type|if a type is meant" }
}; };
D<B> d; // { dg-error "" } D<B> d; // { dg-error "instantiated from here" }
// { dg-do compile }
// Origin: <v dot haisman at sh dot cvut dot cz>
// PR c++/13957: Improved error message for type in template (when non-type
// is expected).
template <class T>
struct A
{
typedef int type;
};
template <class T>
void func(void)
{
(void)A<T>::type(); // { dg-error "if a type is meant" }
// { dg-error "parsed as a non-type" "" { target *-*-* } 15 }
}
template void func<float>(void); // { dg-error "instantiated from here" }
...@@ -16,8 +16,8 @@ template <> struct A::B<false> {}; ...@@ -16,8 +16,8 @@ template <> struct A::B<false> {};
template <typename T> void foo() template <typename T> void foo()
{ {
T::C (); // { dg-error "names a type" "" } T::C (); // { dg-error "parsed as a non-type|if a type is meant" "" }
T::template B<false>(); // { dg-error "names a type" "" } T::template B<false>(); // { dg-error "parsed as a non-type|if a type is meant" "" }
} }
void bar() void bar()
......
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