[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / PCH / specialization-after-instantiation.cpp
bloba10a075f095fd0adb110cda126dc637430f12a3e
1 // Test this without pch.
2 // RUN: %clang_cc1 -fsyntax-only -verify -DBODY %s
4 // Test with pch.
5 // RUN: %clang_cc1 -emit-pch -o %t %s
6 // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify -DBODY %s
8 // RUN: %clang_cc1 -emit-pch -fpch-instantiate-templates -o %t %s
9 // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify -DBODY %s
11 #ifndef HEADER_H
12 #define HEADER_H
14 template <typename T>
15 struct A {
16 int foo() const;
19 int bar(A<double> *a) {
20 return a->foo();
23 #endif // HEADER_H
25 #ifdef BODY
27 template <>
28 int A<double>::foo() const { // expected-error {{explicit specialization of 'foo' after instantiation}} // expected-note@20 {{implicit instantiation first required here}}
29 return 10;
32 #endif // BODY