summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/new-delete.cpp6
-rw-r--r--clang/test/SemaTemplate/explicit-specialization-member.cpp12
2 files changed, 14 insertions, 4 deletions
diff --git a/clang/test/SemaCXX/new-delete.cpp b/clang/test/SemaCXX/new-delete.cpp
index acd4a23cb35..68323d8d075 100644
--- a/clang/test/SemaCXX/new-delete.cpp
+++ b/clang/test/SemaCXX/new-delete.cpp
@@ -159,12 +159,10 @@ void loadEngineFor() {
}
template <class T> struct TBase {
- void* operator new(T size, int); // expected-error {{'operator new' cannot take a dependent type as first parameter; use size_t}}\
- // expected-error {{'operator new' takes type size_t}}
+ void* operator new(T size, int); // expected-error {{'operator new' cannot take a dependent type as first parameter; use size_t}}
};
-// FIXME: We should not try to instantiate operator new, since it is invalid.
-TBase<int> t1; // expected-note {{in instantiation of template class 'struct TBase<int>' requested here}}
+TBase<int> t1;
class X6 {
public:
diff --git a/clang/test/SemaTemplate/explicit-specialization-member.cpp b/clang/test/SemaTemplate/explicit-specialization-member.cpp
index 06dd382fc7a..417cdc1f198 100644
--- a/clang/test/SemaTemplate/explicit-specialization-member.cpp
+++ b/clang/test/SemaTemplate/explicit-specialization-member.cpp
@@ -9,3 +9,15 @@ struct X0 {
template<> void X0<char>::f0(char);
template<> void X0<char>::f1(type);
+
+namespace PR6161 {
+ template<typename _CharT>
+ class numpunct : public locale::facet // expected-error{{use of undeclared identifier 'locale'}} \
+ // expected-error{{expected class name}} \
+ // expected-note{{attempt to specialize declaration here}}
+ {
+ static locale::id id; // expected-error{{use of undeclared identifier}}
+ };
+ numpunct<char>::~numpunct(); // expected-error{{template specialization requires 'template<>'}} \
+ // expected-error{{specialization of member 'PR6161::numpunct<char>::~numpunct' does not specialize an instantiated member}}
+}
OpenPOWER on IntegriCloud