brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · d6396a7 Raw
35 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++14-compat-pedantic -verify %s2// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++14-compat-pedantic -verify %s3 4#if __cplusplus < 201402L5 6// expected-no-diagnostics7// FIXME: C++11 features removed or changed in C++14?8 9#else10 11static_assert(true); // expected-warning {{incompatible with C++ standards before C++17}}12 13template<int ...N> int f() { return (N + ...); } // expected-warning {{incompatible with C++ standards before C++17}}14 15namespace [[]] NS_with_attr {} // expected-warning {{incompatible with C++ standards before C++17}}16enum { e [[]] }; // expected-warning {{incompatible with C++ standards before C++17}}17 18template<typename T = int> struct X {};19X x; // expected-warning {{class template argument deduction is incompatible with C++ standards before C++17; for compatibility, use explicit type name 'X<>'}}20 21template<template<typename> class> struct Y {};22Y<X> yx; // ok, not class template argument deduction23 24template<typename T> void f(T t) {25  X x = t; // expected-warning {{incompatible}}26}27 28template<typename T> void g(T t) {29  typename T::X x = t; // expected-warning {{incompatible}}30}31struct A { template<typename T> struct X { X(T); }; };32void h(A a) { g(a); } // expected-note {{in instantiation of}}33 34#endif35