1 // RUN: %clang_cc1 -std=c++98 %s -verify=expected,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors
2 // RUN: %clang_cc1 -std=c++11 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
3 // RUN: %clang_cc1 -std=c++14 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
4 // RUN: %clang_cc1 -std=c++17 %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
5 // RUN: %clang_cc1 -std=c++2a %s -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
7 namespace cwg1110
{ // cwg1110: 3.1
8 #if __cplusplus >= 201103L
17 decltype(return_T
<A
>())* a
;
18 decltype(return_T
<B
<int>>())* b
;
20 } // namespace cwg1110
22 namespace cwg1111
{ // cwg1111: 3.2
24 template <typename
> struct set
; // #cwg1111-struct-set
27 template <typename T
> void set(const T
&value
); // #cwg1111-func-set
31 // FIXME: should we backport C++11 behavior?
33 // cxx98-error@-1 {{lookup of 'set' in member access expression is ambiguous; using member of 'X'}}
34 // cxx98-note@#cwg1111-func-set {{lookup in the object type 'X' refers here}}
35 // cxx98-note@#cwg1111-struct-set {{lookup from the current scope refers here}}
42 // expected-error@-1 {{no member named 'set' in 'cwg1111::example1::Y'}}
44 } // namespace example1
51 template <class T
> operator T();
59 } // namespace example2
60 } // namespace cwg1111
62 namespace cwg1113
{ // cwg1113: partial
64 extern int a
; // #cwg1113-a
66 // expected-error@-1 {{static declaration of 'a' follows non-static}}
67 // expected-note@#cwg1113-a {{previous declaration is here}}
71 static int a
; // ok, both declarations have internal linkage
75 // FIXME: Per CWG1113 and CWG4, this is ill-formed due to ambiguity: the second
76 // 'f' has internal linkage, and so does not have C language linkage, so is
77 // not a redeclaration of the first 'f'.
79 // To avoid a breaking change here, Clang ignores the "internal linkage" effect
80 // of anonymous namespaces on declarations declared within an 'extern "C"'
81 // linkage-specification.