r314391 - Use std::is_trivial instead of is_trivially_copyable.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 28 01:50:30 PDT 2017


Author: d0k
Date: Thu Sep 28 01:50:30 2017
New Revision: 314391

URL: http://llvm.org/viewvc/llvm-project?rev=314391&view=rev
Log:
Use std::is_trivial instead of is_trivially_copyable.

The oldest versions of GCC we support (before 5) didn't support that
trait. is_trivial is stronger superset that clang::Token fulfills, so
just use that instead.

Modified:
    cfe/trunk/lib/Lex/MacroArgs.cpp

Modified: cfe/trunk/lib/Lex/MacroArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/MacroArgs.cpp?rev=314391&r1=314390&r2=314391&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/MacroArgs.cpp (original)
+++ cfe/trunk/lib/Lex/MacroArgs.cpp Thu Sep 28 01:50:30 2017
@@ -62,11 +62,11 @@ MacroArgs *MacroArgs::create(const Macro
 
   // Copy the actual unexpanded tokens to immediately after the result ptr.
   if (!UnexpArgTokens.empty()) {
-    static_assert(std::is_trivially_copyable<Token>::value,
+    static_assert(std::is_trivial<Token>::value,
                   "assume trivial copyability if copying into the "
                   "uninitialized array (as opposed to reusing a cached "
                   "MacroArgs)");
-    std::copy(UnexpArgTokens.begin(), UnexpArgTokens.end(), 
+    std::copy(UnexpArgTokens.begin(), UnexpArgTokens.end(),
               Result->getTrailingObjects<Token>());
   }
 




More information about the cfe-commits mailing list