[cfe-commits] r164804 - in /cfe/trunk: lib/AST/TypeLoc.cpp test/SemaTemplate/deduction-crash.cpp

Eli Friedman eli.friedman at gmail.com
Thu Sep 27 15:13:33 PDT 2012


Author: efriedma
Date: Thu Sep 27 17:13:33 2012
New Revision: 164804

URL: http://llvm.org/viewvc/llvm-project?rev=164804&view=rev
Log:
Fix a regression from r164656.


Modified:
    cfe/trunk/lib/AST/TypeLoc.cpp
    cfe/trunk/test/SemaTemplate/deduction-crash.cpp

Modified: cfe/trunk/lib/AST/TypeLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypeLoc.cpp?rev=164804&r1=164803&r2=164804&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypeLoc.cpp (original)
+++ cfe/trunk/lib/AST/TypeLoc.cpp Thu Sep 27 17:13:33 2012
@@ -301,7 +301,6 @@
     case TemplateArgument::Null: 
     case TemplateArgument::Declaration:
     case TemplateArgument::Integral:
-    case TemplateArgument::Pack:
     case TemplateArgument::NullPtr:
       llvm_unreachable("Impossible TemplateArgument");
 
@@ -331,7 +330,11 @@
                                             ? SourceLocation()
                                             : Loc);
       break;
-    }        
+    }
+
+    case TemplateArgument::Pack:
+      ArgInfos[i] = TemplateArgumentLocInfo();
+      break;
     }
   }
 }

Modified: cfe/trunk/test/SemaTemplate/deduction-crash.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/deduction-crash.cpp?rev=164804&r1=164803&r2=164804&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/deduction-crash.cpp (original)
+++ cfe/trunk/test/SemaTemplate/deduction-crash.cpp Thu Sep 27 17:13:33 2012
@@ -99,3 +99,14 @@
     return 0;
   }
 }
+
+// A buildbot failure from libcxx
+namespace libcxx_test {
+  template <class _Ptr, bool> struct __pointer_traits_element_type;
+  template <class _Ptr> struct __pointer_traits_element_type<_Ptr, true>;
+  template <template <class, class...> class _Sp, class _Tp, class ..._Args> struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true> {
+    typedef char type;
+  };
+  template <class T> struct B {};
+  __pointer_traits_element_type<B<int>, true>::type x;
+}





More information about the cfe-commits mailing list