30 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <fstream>10 11// template <class charT, class traits = char_traits<charT> >12// class basic_fstream13 14// The char type of the stream and the char_type of the traits have to match15 16// UNSUPPORTED: no-wide-characters17 18#include <fstream>19 20std::basic_fstream<char, std::char_traits<wchar_t> > f;21// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}22// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}23 24// expected-error@*:* 11 {{only virtual member functions can be marked 'override'}}25 26// FIXME: As of commit r324062 Clang incorrectly generates a diagnostic about mismatching27// exception specifications for types which are already invalid for one reason or another.28// For now we tolerate this diagnostic.29// expected-error@*:* 0-1 {{exception specification of overriding function is more lax than base version}}30