[llvm-branch-commits] [cfe-branch] r118564 - in /cfe/branches/Apple/whitney: lib/Sema/SemaTemplateDeduction.cpp test/SemaCXX/crashes.cpp
Daniel Dunbar
daniel at zuster.org
Tue Nov 9 09:32:04 PST 2010
Author: ddunbar
Date: Tue Nov 9 11:32:04 2010
New Revision: 118564
URL: http://llvm.org/viewvc/llvm-project?rev=118564&view=rev
Log:
Merge r118314:
--
Author: Argyrios Kyrtzidis <akyrtzi at gmail.com>
Date: Fri Nov 5 23:25:18 2010 +0000
When determining which template partial specialization is more specialized,
make sure to setup the instantiation stack. Fixes rdar://8620775 & http://llvm.org/PR8234
Modified:
cfe/branches/Apple/whitney/lib/Sema/SemaTemplateDeduction.cpp
cfe/branches/Apple/whitney/test/SemaCXX/crashes.cpp
Modified: cfe/branches/Apple/whitney/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Sema/SemaTemplateDeduction.cpp?rev=118564&r1=118563&r2=118564&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Sema/SemaTemplateDeduction.cpp Tue Nov 9 11:32:04 2010
@@ -2485,10 +2485,13 @@
Info,
Deduced,
0);
- if (Better1)
+ if (Better1) {
+ InstantiatingTemplate Inst(*this, PS2->getLocation(), PS2,
+ Deduced.data(), Deduced.size(), Info);
Better1 = !::FinishTemplateArgumentDeduction(*this, PS2,
PS1->getTemplateArgs(),
Deduced, Info);
+ }
// Determine whether PS2 is at least as specialized as PS1
Deduced.clear();
@@ -2500,10 +2503,13 @@
Info,
Deduced,
0);
- if (Better2)
+ if (Better2) {
+ InstantiatingTemplate Inst(*this, PS1->getLocation(), PS1,
+ Deduced.data(), Deduced.size(), Info);
Better2 = !::FinishTemplateArgumentDeduction(*this, PS1,
PS2->getTemplateArgs(),
Deduced, Info);
+ }
if (Better1 == Better2)
return 0;
Modified: cfe/branches/Apple/whitney/test/SemaCXX/crashes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/SemaCXX/crashes.cpp?rev=118564&r1=118563&r2=118564&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/SemaCXX/crashes.cpp (original)
+++ cfe/branches/Apple/whitney/test/SemaCXX/crashes.cpp Tue Nov 9 11:32:04 2010
@@ -41,3 +41,30 @@
new Y // expected-error{{no viable conversion}}
};
}
+
+// http://llvm.org/PR8234
+namespace PR8234 {
+template<typename Signature>
+class callback
+{
+};
+
+template<typename R , typename ARG_TYPE0>
+class callback<R( ARG_TYPE0)>
+{
+ public:
+ callback() {}
+};
+
+template< typename ARG_TYPE0>
+class callback<void( ARG_TYPE0)>
+{
+ public:
+ callback() {}
+};
+
+void f()
+{
+ callback<void(const int&)> op;
+}
+}
More information about the llvm-branch-commits
mailing list