[PATCH] D40948: Switch Clang's default C++ language target to C++14

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 13:25:45 PST 2017


rsmith added inline comments.


================
Comment at: clang/test/CodeGenCXX/new-overflow.cpp:88
   // CHECK:      [[N:%.*]] = sext i16 {{%.*}} to i32
-  // CHECK-NEXT: [[T0:%.*]] = icmp slt i32 [[N]], 0
-  // CHECK-NEXT: [[T1:%.*]] = select i1 [[T0]], i32 -1, i32 [[N]]
-  // CHECK-NEXT: call i8* @_Znaj(i32 [[T1]])
+  // CHECK-NEXT: call i8* @_Znaj(i32 [[N]])
   // CHECK:      getelementptr inbounds {{.*}}, i32 [[N]]
----------------
The changes in this file are a regression; C++14 requires us to check whether the array bound prior to promotion is negative. Can you file a bug on that?


================
Comment at: clang/test/CodeGenCXX/vtable-available-externally.cpp:1-2
-// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -o %t
-// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -O2 -disable-llvm-passes -emit-llvm -o %t.opt
+// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -std=c++98 -emit-llvm -o %t
+// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -std=c++98 -O2 -disable-llvm-passes -emit-llvm -o %t.opt
 // RUN: FileCheck --check-prefix=CHECK-TEST1 %s < %t
----------------
Why does this one need a -std= flag?


================
Comment at: clang/test/Parser/cxx1z-nested-namespace-definition.cpp:3-4
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98
 // RUN: not %clang_cc1 -x c++ -fixit %t -Werror -DFIXIT
 // RUN: %clang_cc1 -x c++ %t -DFIXIT
 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17 -Wc++14-compat
----------------
I think these two should also be `-std=c++98`, right?


================
Comment at: clang/test/SemaCXX/unknown-type-name.cpp:98
 
-template<typename T> int junk1(T::junk); // expected-warning{{variable templates are a C++14 extension}}
+template<typename T> int junk1(T::junk);
+#if __cplusplus <= 201103L
----------------
Huh, we should probably have a `-Wvexing-parse` warning for this. Can you file a bug?


================
Comment at: clang/test/SemaCXX/unknown-type-name.cpp:110-111
 
 // FIXME: We can tell this was intended to be a function because it does not
 //        have a dependent nested name specifier.
+template<typename T> int i(T::type, int());
----------------
Maybe delete this (incorrect in C++14) FIXME?


Repository:
  rC Clang

https://reviews.llvm.org/D40948





More information about the cfe-commits mailing list