Could you add cast_or_null also in the ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E), otherwise the deserialization would be out of sync.
Vassil
On 10/10/14 20:58, Alexey Bataev wrote:
Author: abataev
Date: Fri Oct 10 13:58:13 2014
New Revision: 219525

URL: http://llvm.org/viewvc/llvm-project?rev=219525&view=rev
Log:
Bugfix for predefined expressions in dependent context.
This bug break compilation with precompiled headers and predefined expressions 
in dependent context.

Modified:
     cfe/trunk/lib/AST/Expr.cpp
     cfe/trunk/test/CodeGenCXX/predefined-expr-cxx14.cpp

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=219525&r1=219524&r2=219525&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Fri Oct 10 13:58:13 2014
@@ -457,7 +457,7 @@ PredefinedExpr::PredefinedExpr(SourceLoc
        Loc(L), Type(IT), FnName(SL) {}
StringLiteral *PredefinedExpr::getFunctionName() {
-  return cast<StringLiteral>(FnName);
+  return cast_or_null<StringLiteral>(FnName);
  }
StringRef PredefinedExpr::getIdentTypeName(PredefinedExpr::IdentType IT) {

Modified: cfe/trunk/test/CodeGenCXX/predefined-expr-cxx14.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/predefined-expr-cxx14.cpp?rev=219525&r1=219524&r2=219525&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/predefined-expr-cxx14.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/predefined-expr-cxx14.cpp Fri Oct 10 13:58:13 2014
@@ -1,4 +1,9 @@
  // RUN: %clang_cc1 -std=c++14 %s -triple %itanium_abi_triple -fblocks 
-emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -x c++ -std=c++14 -triple %itanium_abi_triple -fblocks 
-emit-pch -o %t %s
+// RUN: %clang_cc1 -x c++ -triple %itanium_abi_triple -std=c++14 -fblocks 
-include-pch %t %s -emit-llvm -o - | FileCheck %s
+
+#ifndef HEADER
+#define HEADER
// CHECK-DAG: @__func__._ZN13ClassTemplateIiE21classTemplateFunctionERi = private unnamed_addr constant [22 x i8] c"classTemplateFunction\00"
  // CHECK-DAG: @__PRETTY_FUNCTION__._ZN13ClassTemplateIiE21classTemplateFunctionERi = private 
unnamed_addr constant [69 x i8] c"const auto 
&ClassTemplate<int>::classTemplateFunction(T &) [T = int]\00"
@@ -81,3 +86,5 @@ int main() {
    t.classTemplateFunction(a);
    return 0;
  }
+#endif
+


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


--
--------------------------------------------
Q: Why is this email five sentences or less?
A: http://five.sentenc.es

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to