1 // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
2 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
3 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
4 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
5 // RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
7 namespace dr1111
{ // dr1111: yes
9 template <typename
> struct set
;
12 template <typename T
> void set(const T
&value
);
16 #pragma clang diagnostic push
17 #if __cplusplus < 201103L
18 #pragma clang diagnostic ignored "-Wambiguous-member-template"
21 #pragma clang diagnostic pop
27 y
.set
<double>(3.2); // expected-error {{no member named 'set' in 'dr1111::example1::Y'}}
29 } // namespace example1
36 template <class T
> operator T();
44 } // namespace example2
47 namespace dr1113
{ // dr1113: partial
49 extern int a
; // expected-note {{previous}}
50 static int a
; // expected-error {{static declaration of 'a' follows non-static}}
54 static int a
; // ok, both declarations have internal linkage
58 // FIXME: Per DR1113 and DR4, this is ill-formed due to ambiguity: the second
59 // 'f' has internal linkage, and so does not have C language linkage, so is
60 // not a redeclaration of the first 'f'.
62 // To avoid a breaking change here, Clang ignores the "internal linkage" effect
63 // of anonymous namespaces on declarations declared within an 'extern "C"'
64 // linkage-specification.