commit bdaa797823a9e45261cfe7a97e4f568decba790b
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jan 12 12:42:07 2012 -0500
PR c++/36797
* mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
@@ -2808,7 +2808,17 @@ write_expression (tree expr)
if (name == NULL)
{
- sorry ("mangling %C", code);
+ switch (code)
+ {
+ case TRAIT_EXPR:
+ error ("use of built-in trait %qE in function signature; "
+ "use library traits instead", expr);
+ break;
+
+ default:
+ sorry ("mangling %C", code);
+ break;
+ }
return;
}
else
new file mode 100644
@@ -0,0 +1,11 @@
+// PR c++/36797
+
+template <int> struct A { };
+
+template <class T>
+int foo (A<__is_empty (T)>* = 0); // { dg-error "built-in trait" }
+
+int main ()
+{
+ foo<int>();
+}