Home | History | Annotate | Download | only in over.literal
      1 // RUN: %clang_cc1 -std=c++11 %s -verify
      2 
      3 using size_t = decltype(sizeof(int));
      4 
      5 // Acceptable parameter declarations
      6 char operator "" _a(const char *);
      7 char operator "" _a(const char []);
      8 char operator "" _a(unsigned long long);
      9 char operator "" _a(long double);
     10 char operator "" _a(char);
     11 char operator "" _a(const volatile char);
     12 char operator "" _a(wchar_t);
     13 char operator "" _a(char16_t);
     14 char operator "" _a(char32_t);
     15 char operator "" _a(const char *, size_t);
     16 char operator "" _a(const wchar_t *, size_t);
     17 char operator "" _a(const char16_t *, size_t);
     18 char operator "" _a(const char32_t *, size_t);
     19 char operator "" _a(const char [32], size_t);
     20 
     21 // Unacceptable parameter declarations
     22 char operator "" _b(); // expected-error {{parameter}}
     23 char operator "" _b(const wchar_t *); // expected-error {{parameter}}
     24 char operator "" _b(long long); // expected-error {{parameter}}
     25 char operator "" _b(double); // expected-error {{parameter}}
     26 char operator "" _b(short); // expected-error {{parameter}}
     27 char operator "" _a(char, int = 0); // expected-error {{parameter}}
     28 char operator "" _b(unsigned short); // expected-error {{parameter}}
     29 char operator "" _b(signed char); // expected-error {{parameter}}
     30 char operator "" _b(unsigned char); // expected-error {{parameter}}
     31 char operator "" _b(const short *, size_t); // expected-error {{parameter}}
     32 char operator "" _b(const unsigned short *, size_t); // expected-error {{parameter}}
     33 char operator "" _b(const signed char *, size_t); // expected-error {{parameter}}
     34 char operator "" _b(const unsigned char *, size_t); // expected-error {{parameter}}
     35 char operator "" _a(const volatile char *, size_t); // expected-error {{parameter}}
     36 char operator "" _a(volatile wchar_t *, size_t); // expected-error {{parameter}}
     37 char operator "" _a(char16_t *, size_t); // expected-error {{parameter}}
     38 char operator "" _a(const char32_t *, size_t, bool = false); // expected-error {{parameter}}
     39 char operator "" _a(const char *, signed long); // expected-error {{parameter}}
     40 char operator "" _a(const char *, size_t = 0); // expected-error {{default argument}}
     41