blob: 0d915d01474c3d6cad9b307447244607a342b1d9 [file] [log] [blame]
Richard Smith46d04a32017-01-08 04:01:15 +00001// RUN: %clang_cc1 -fsyntax-only %s -std=c++14 -verify
2
3// This is a test for an egregious hack in Clang that works around
4// an issue with libstdc++'s detection of whether glibc provides a
5// ::gets function. If there is no ::gets, ignore
6// using ::gets;
7// in namespace std.
8//
9// See PR18402 and gcc.gnu.org/PR77795 for more details.
10
11#ifdef BE_THE_HEADER
12
13#pragma GCC system_header
14namespace std {
15 using ::gets;
16 using ::getx; // expected-error {{no member named 'getx'}}
17}
18
19#else
20
21#define BE_THE_HEADER
22#include "libstdcxx_pointer_return_false_hack.cpp"
23
24namespace foo {
25 using ::gets; // expected-error {{no member named 'gets'}}
26}
27
28#endif