tree overload = NULL_TREE;
tree op = build_nt (modifycode, NULL_TREE, NULL_TREE);
+ if (lhs == error_mark_node || rhs == error_mark_node)
+ return cp_expr (error_mark_node, loc);
+
if (processing_template_decl)
{
if (modifycode == NOP_EXPR
template<int> void foo()
{
- int x[=]; // { dg-error "expected" }
+ int x[=]; // { dg-error "" }
[&x]{};
}
void bar()
{
- foo<0>();
+ foo<0>(); // { dg-prune-output "not declared" }
}
template<typename T> void foo()
{
T x[=]; // { dg-error "expected" }
- [&x]{};
+ [&x]{}; // { dg-prune-output "not declared" }
}
template<typename> struct B : A<sizeof(0=0r)> {}; // { dg-error "not supported" }
template<typename> struct C : A<sizeof(0=0r)> {}; // { dg-error "not supported" }
+
+// { dg-prune-output "template argument" }
X = y*rhs.z() - z*rhs.y(); // { dg-error "not declared|no member" }
}
Vec& operator^(Vec& rhs) {
- return Vec(*this)^=rhs; // { dg-message "required" }
+ return Vec(*this)^=rhs;
}
};
Vec<double> v(3,4,12); // { dg-error "no matching|too many initializers" }
Vec<double> V(12,4,3); // { dg-error "no matching|too many initializers" }
-Vec<double> c = v^V; // { dg-message "required" }
+Vec<double> c = v^V;
// PR c++/33494
-template<int> void foo(int(*f=0)()); // { dg-error "declared void|scope|erroneous-expression" }
+template<int> void foo(int(*f=0)()); // { dg-error "declared void|scope|cannot be used as a function" }
template<int> struct A {};
-template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "expected primary-expression" } */
+template<typename> struct B : A <sizeof(=)> {}; /* { dg-error "" } */
-template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "expected primary-expression" } */
+template<typename> struct C : A <sizeof(=)> {}; /* { dg-error "" } */
int a;