blob: 6a3881cf4217329bcfc31c99f630b150783e1937 [file] [log] [blame]
Richard Smith41be6732011-10-14 20:48:27 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify %s
Richard Smith84ef8992011-10-14 20:41:13 +00002
3template<typename ...T> // expected-warning {{variadic templates are incompatible with C++98}}
4class Variadic1 {};
5
6template<template<typename> class ...T> // expected-warning {{variadic templates are incompatible with C++98}}
7class Variadic2 {};
8
9template<int ...I> // expected-warning {{variadic templates are incompatible with C++98}}
10class Variadic3 {};
Richard Smith41be6732011-10-14 20:48:27 +000011
12int alignas(8) with_alignas; // expected-warning {{'alignas' is incompatible with C++98}}
13int with_attribute [[ ]]; // expected-warning {{attributes are incompatible with C++98}}
Richard Smith661a9962011-10-15 01:18:56 +000014
15void Literals() {
16 (void)u8"str"; // expected-warning {{unicode literals are incompatible with C++98}}
17 (void)u"str"; // expected-warning {{unicode literals are incompatible with C++98}}
18 (void)U"str"; // expected-warning {{unicode literals are incompatible with C++98}}
19 (void)u'x'; // expected-warning {{unicode literals are incompatible with C++98}}
20 (void)U'x'; // expected-warning {{unicode literals are incompatible with C++98}}
21
22 (void)u8R"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
23 (void)uR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
24 (void)UR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
25 (void)R"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
26 (void)LR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
27}
28
29template<typename T> struct S {};
30S<::S<void> > s; // expected-warning {{'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98}}