1 // { dg-additional-options "-Wno-return-type" }
3 typedef unsigned int source_location;
4 typedef source_location location_t;
5 extern void error_at (location_t, const char *, ...)
6 __attribute__ ((__format__ (__gcc_tdiag__, 2, 3)))
7 __attribute__ ((__nonnull__ (2)));
11 static int fetch_char (const char *str, unsigned int *value);
12 location_t location () const;
13 const char *advance_one_utf8_char (const char *, unsigned int *, bool *);
14 const char *advance_one_char (const char *, bool, unsigned int *, bool *);
20 Lex::fetch_char (const char *p, unsigned int *value)
27 else if ((c & 0xe0) == 0xc0 && (p[1] & 0xc0) == 0x80)
29 *value = (((c & 0x1f) << 6) + (p[1] & 0x3f));
32 *value = (((c & 0xf) << 12) + (p[2] & 0x3f));
37 Lex::advance_one_utf8_char (const char *p, unsigned int *value,
40 *issued_error = false;
46 int adv = Lex::fetch_char (p, value);
47 if (*value == 0xfeff && (this->lineno_ != 1 || this->lineoff_ != 0))
55 Lex::advance_one_char (const char *p, bool is_single_quote,
56 unsigned int *value, bool * is_character)
60 const char *ret = this->advance_one_utf8_char (p, value, &issued_error);
62 && (*value == '\'' || *value == '\n') && !issued_error)
63 error_at (this->location (), "invalid character literal");