From 1a88adbb27a21e7728253c2f932b41009e314985 Mon Sep 17 00:00:00 2001 From: Charles Li Date: Thu, 14 Apr 2016 23:47:07 +0000 Subject: Lit C++11 Compatibility Patch #8 24 tests have been updated for C++11 compatibility. llvm-svn: 266387 --- clang/test/Parser/cxx-friend.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'clang/test/Parser/cxx-friend.cpp') diff --git a/clang/test/Parser/cxx-friend.cpp b/clang/test/Parser/cxx-friend.cpp index ace0ff26e2d..a4492ba1a7a 100644 --- a/clang/test/Parser/cxx-friend.cpp +++ b/clang/test/Parser/cxx-friend.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s class C { friend class D; @@ -21,9 +23,20 @@ class B { // 'A' here should refer to the declaration above. friend class A; - friend C; // expected-warning {{specify 'class' to befriend}} - friend U; // expected-warning {{specify 'union' to befriend}} - friend int; // expected-warning {{non-class friend type 'int'}} + friend C; +#if __cplusplus <= 199711L + // expected-warning@-2 {{unelaborated friend declaration is a C++11 extension; specify 'class' to befriend 'C'}} +#endif + + friend U; +#if __cplusplus <= 199711L + // expected-warning@-2 {{unelaborated friend declaration is a C++11 extension; specify 'union' to befriend 'U'}} +#endif + + friend int; +#if __cplusplus <= 199711L + // expected-warning@-2 {{non-class friend type 'int' is a C++11 extension}} +#endif friend void myfunc(); -- cgit v1.2.3