diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-04-09 21:02:29 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-04-09 21:02:29 +0000 |
| commit | 06aa50417d79b0bf1e9bf90dbf2e2168436f79a9 (patch) | |
| tree | 93f65c5f57e3acd5949f1eb0092173d816ad3b8b /clang/test | |
| parent | 4e8bd580016762cde37efc415044e56f5dc332e8 (diff) | |
| download | bcm5719-llvm-06aa50417d79b0bf1e9bf90dbf2e2168436f79a9.tar.gz bcm5719-llvm-06aa50417d79b0bf1e9bf90dbf2e2168436f79a9.zip | |
Only complain about explicit instantiations following explicit
specializations when the explicit instantiation was... explicitly
written, i.e., not the product of an explicit instantiation of an
enclosing class. Fixes this spurious warning when Clang builds LLVM:
/Volumes/Data/dgregor/Projects/llvm/lib/CodeGen/MachineDominators.cpp:22:1:
warning: explicit instantiation of 'addRoot' that occurs after an
explicit specialization will be ignored (C++0x extension) [-pedantic]
llvm-svn: 100900
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CXX/temp/temp.spec/temp.explicit/p4.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/clang/test/CXX/temp/temp.spec/temp.explicit/p4.cpp b/clang/test/CXX/temp/temp.spec/temp.explicit/p4.cpp index 2b852136f30..d3043741151 100644 --- a/clang/test/CXX/temp/temp.spec/temp.explicit/p4.cpp +++ b/clang/test/CXX/temp/temp.spec/temp.explicit/p4.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s template<typename T> void f0(T); // expected-note{{here}} template void f0(int); // expected-error{{explicit instantiation of undefined function template}} @@ -16,20 +16,20 @@ template void X0<int>::f1(); // expected-error{{explicit instantiation of undefi template int X0<int>::value; // expected-error{{explicit instantiation of undefined static data member}} -template<> void f0(long); -template void f0(long); // okay +template<> void f0(long); // expected-note{{previous template specialization is here}} +template void f0(long); // expected-warning{{explicit instantiation of 'f0<long>' that occurs after an explicit specialization will be ignored}} -template<> void X0<long>::f1(); -template void X0<long>::f1(); +template<> void X0<long>::f1(); // expected-note{{previous template specialization is here}} +template void X0<long>::f1(); // expected-warning{{explicit instantiation of 'f1' that occurs after an explicit specialization will be ignored}} -template<> struct X0<long>::Inner; -template struct X0<long>::Inner; +template<> struct X0<long>::Inner; // expected-note{{previous template specialization is here}} +template struct X0<long>::Inner; // expected-warning{{explicit instantiation of 'Inner' that occurs after an explicit specialization will be ignored}} -template<> long X0<long>::value; -template long X0<long>::value; +template<> long X0<long>::value; // expected-note{{previous template specialization is here}} +template long X0<long>::value; // expected-warning{{explicit instantiation of 'value' that occurs after an explicit specialization will be ignored}} -template<> struct X0<double>; -template struct X0<double>; +template<> struct X0<double>; // expected-note{{previous template specialization is here}} +template struct X0<double>; // expected-warning{{explicit instantiation of 'X0<double>' that occurs after an explicit specialization will be ignored}} // PR 6458 namespace test0 { |

