+1999-05-19 Mark Mitchell <mark@codesourcery.com>
+
+ * tree.c (cp_build_qualified_type): Don't allow qualified function
+ types.
+
Wed May 19 02:50:53 1999 Arvind Sankar <arvinds@mit.edu>
* gxxint.texi: Fix typo.
type_quals &= ~TYPE_QUAL_RESTRICT;
}
- if (TREE_CODE (type) == ARRAY_TYPE)
+ if (type_quals != TYPE_UNQUALIFIED
+ && TREE_CODE (type) == FUNCTION_TYPE)
+ {
+ cp_error ("`%T' cannot be `const'-, `volatile'-, or `restrict'-qualified", type);
+ type_quals = TYPE_UNQUALIFIED;
+ }
+ else if (TREE_CODE (type) == ARRAY_TYPE)
{
tree real_main_variant = TYPE_MAIN_VARIANT (type);
};
typedef int const * bart ();
-typedef bart const * const * bar2;
+typedef bart const * const * bar2; // ERROR - qualifiers
bar2 baz (X::Y y)
{
--- /dev/null
+// Build don't link:
+// Origin: Benjamin Pflugmann <philemon@spin.de>
+// Special g++ Options: -O
+
+typedef const char *(func_type)();
+
+class
+{
+public:
+ func_type *Function;
+ const func_type* function(void) { return Function; } // ERROR - qualifiers
+} action;
+
+void work(const char *source)
+{
+ work( action.function()() );
+}