Skip to content
Snippets Groups Projects
  1. Jan 20, 2017
  2. Jan 19, 2017
    • Richard Smith's avatar
      PR13403 (+duplicates): implement C++ DR1310 (http://wg21.link/cwg1310). · a669043d
      Richard Smith authored
      Under this defect resolution, the injected-class-name of a class or class
      template cannot be used except in very limited circumstances (when declaring a
      constructor, in a nested-name-specifier, in a base-specifier, or in an
      elaborated-type-specifier). This is apparently done to make parsing easier, but
      it's a pain for us since we don't know whether a template-id using the
      injected-class-name is valid at the point when we annotate it (we don't yet
      know whether the template-id will become part of an elaborated-type-specifier).
      
      As a tentative resolution to a perceived language defect, mem-initializer-ids
      are added to the list of exceptions here (they generally follow the same rules
      as base-specifiers).
      
      When the reference to the injected-class-name uses the 'typename' or 'template'
      keywords, we permit it to be used to name a type or template as an extension;
      other compilers also accept some cases in this area. There are also a couple of
      corner cases with dependent template names that we do not yet diagnose, but
      which will also get this treatment.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292518 91177308-0d34-0410-b5e6-96231b3b80d8
      a669043d
  3. Jan 18, 2017
  4. Jan 13, 2017
    • Richard Smith's avatar
      Implement DR1265 (wg21.link/cwg1265). · bcbed8b1
      Richard Smith authored
      Diasllow a declaration using the 'auto' type specifier from using two different
      meanings of it at once, or from declaring multiple functions with deduced
      return types or introducing multiple trailing return types.
      
      The standard does not technically disallow the multiple trailing return types
      case if all the declarators declare variables (such as function pointers with
      trailing return types), but we disallow that too, following the clear intent.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291880 91177308-0d34-0410-b5e6-96231b3b80d8
      bcbed8b1
    • Richard Smith's avatar
      Update C++ status pages for Clang 4 branch: · 71e04144
      Richard Smith authored
       * Update version number in DR tests from 4.0 to 4
       * Teach make_cxx_dr_status script about version numbers that don't contain a
         period.
       * Update cxx_status.html and cxx_dr_status.html to list Clang 4 features as
         "Clang 4" rather than "SVN"
      
      Clang 4 features are still listed in yellow rather than green until release.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291871 91177308-0d34-0410-b5e6-96231b3b80d8
      71e04144
  5. Jan 12, 2017
  6. Jan 09, 2017
    • Richard Smith's avatar
      Implement C++ DR1391 (wg21.link/cwg1391) · 7937c287
      Richard Smith authored
      Check for implicit conversion sequences for non-dependent function
      template parameters between deduction and substitution. The idea is to accept
      as many cases as possible, on the basis that substitution failure outside the
      immediate context is much more common during substitution than during implicit
      conversion sequence formation.
      
      This re-commits r290808, reverted in r290811 and r291412, with a couple of
      fixes for handling of explicitly-specified non-trailing template argument
      packs.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291427 91177308-0d34-0410-b5e6-96231b3b80d8
      7937c287
    • Richard Smith's avatar
      Implement DR1388 (wg21.link/cwg1388). · dd6177c3
      Richard Smith authored
      This issue clarifies how deduction proceeds past a non-trailing function
      parameter pack. Essentially, the pack itself is skipped and consumes no
      arguments (except for those implied by an explicitly-specified template
      arguments), and nothing is deduced from it. As a small fix to the standard's
      rule, we do not allow subsequent deduction to change the length of the function
      parameter pack (by preventing extension of the explicitly-specified pack if
      present, and otherwise deducing all contained packs to empty packs).
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291425 91177308-0d34-0410-b5e6-96231b3b80d8
      dd6177c3
    • Richard Smith's avatar
      Revert r291410 and r291411. · 4711e171
      Richard Smith authored
      The test-suite bots are still failing even after r291410's fix.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291412 91177308-0d34-0410-b5e6-96231b3b80d8
      4711e171
    • Richard Smith's avatar
      Implement C++ DR1391 (wg21.link/cwg1391) · f3bc0e63
      Richard Smith authored
      Check for implicit conversion sequences for non-dependent function
      template parameters between deduction and substitution. The idea is to accept
      as many cases as possible, on the basis that substitution failure outside the
      immediate context is much more common during substitution than during implicit
      conversion sequence formation.
      
      This re-commits r290808, reverted in r290811, with a fix for handling of
      explicitly-specified template argument packs.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291410 91177308-0d34-0410-b5e6-96231b3b80d8
      f3bc0e63
  7. Jan 02, 2017
  8. Dec 31, 2016
    • Richard Smith's avatar
      [c++17] Implement P0522R0 as written. This allows a template template argument · 2faed1c4
      Richard Smith authored
      to be specified for a template template parameter whenever the parameter is at
      least as specialized as the argument (when there's an obvious and correct
      mapping from uses of the parameter to uses of the argument). For example, a
      template with more parameters can be passed to a template template parameter
      with fewer, if those trailing parameters have default arguments.
      
      This is disabled by default, despite being a DR resolution, as it's fairly
      broken in its current state: there are no partial ordering rules to cope with
      template template parameters that have different parameter lists, meaning that
      code that attempts to decompose template-ids based on arity can hit unavoidable
      ambiguity issues.
      
      The diagnostics produced on a non-matching argument are also pretty bad right
      now, but I aim to improve them in a subsequent commit.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290792 91177308-0d34-0410-b5e6-96231b3b80d8
      2faed1c4
  9. Dec 28, 2016
  10. Dec 27, 2016
  11. Dec 19, 2016
  12. Dec 14, 2016
  13. Dec 09, 2016
  14. Dec 08, 2016
    • Richard Smith's avatar
      [c++1z] P0003R5: Removing dynamic exception specifications. · 1f0155f2
      Richard Smith authored
      We continue to support dynamic exception specifications in C++1z as an
      extension, but produce an error-by-default warning when we encounter one. This
      allows users to opt back into the feature with a warning flag, and implicitly
      opts system headers back into the feature should they happen to use it.
      
      There is one semantic change implied by P0003R5 but not implemented here:
      violating a throw() exception specification should now call std::terminate
      directly instead of calling std::unexpected(), but since P0003R5 also removes
      std::unexpected() and std::set_unexpected, and the default unexpected handler
      calls std::terminate(), a conforming C++1z program cannot tell that we are
      still calling it. The upside of this strategy is perfect backwards
      compatibility; the downside is that we don't get the more efficient 'noexcept'
      codegen for 'throw()'.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289019 91177308-0d34-0410-b5e6-96231b3b80d8
      1f0155f2
  15. Dec 07, 2016
  16. Dec 05, 2016
    • Richard Smith's avatar
      DR1213: element access on an array xvalue or prvalue produces an xvalue. In the · 88800602
      Richard Smith authored
      latter case, a temporary array object is materialized, and can be
      lifetime-extended by binding a reference to the member access. Likewise, in an
      array-to-pointer decay, an rvalue array is materialized before being converted
      into a pointer.
      
      This caused IR generation to stop treating file-scope array compound literals
      as having static storage duration in some cases in C++; that has been rectified
      by modeling such a compound literal as an lvalue. This also improves clang's
      compatibility with GCC for those cases.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288654 91177308-0d34-0410-b5e6-96231b3b80d8
      88800602
  17. Dec 03, 2016
  18. Dec 01, 2016
  19. Nov 16, 2016
  20. Nov 12, 2016
  21. Nov 11, 2016
  22. Nov 07, 2016
  23. Nov 01, 2016
  24. Oct 26, 2016
  25. Oct 22, 2016
    • Richard Smith's avatar
      Mark P0012R1 as "Partial" since it's now substantially complete. · fdc43f78
      Richard Smith authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284907 91177308-0d34-0410-b5e6-96231b3b80d8
      fdc43f78
    • Richard Smith's avatar
      [c++1z] P0012R1: Implement a few remaining pieces: downgrade diagnostic for · bb4ce7e2
      Richard Smith authored
      mismatched dynamic exception specifications in expressions from an error to a
      warning, since this is no longer ill-formed in C++1z.
      
      Allow reference binding of a reference-to-non-noexcept function to a noexcept
      function lvalue. As defect resolutions, also allow a conditional between
      noexcept and non-noexcept function lvalues to produce a non-noexcept function
      lvalue (rather than decaying to a function pointer), and allow function
      template argument deduction to deduce a reference to non-noexcept function when
      binding to a noexcept function type.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284905 91177308-0d34-0410-b5e6-96231b3b80d8
      bb4ce7e2
    • Richard Smith's avatar
      DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules. · 4b6ad142
      Richard Smith authored
      This has two significant effects:
      
      1) Direct relational comparisons between null pointer constants (0 and nullopt)
         and pointers are now ill-formed. This was always the case for C, and it
         appears that C++ only ever permitted by accident. For instance, cases like
           nullptr < &a
         are now rejected.
      
      2) Comparisons and conditional operators between differently-cv-qualified
         pointer types now work, and produce a composite type that both source
         pointer types can convert to (when possible). For instance, comparison
         between 'int **' and 'const int **' is now valid, and uses an intermediate
         type of 'const int *const *'.
      
      Clang previously supported #2 as an extension.
      
      We do not accept the cases in #1 as an extension. I've tested a fair amount of
      code to check that this doesn't break it, but if it turns out that someone is
      relying on this, we can easily add it back as an extension.
      
      This is a re-commit of r284800.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284890 91177308-0d34-0410-b5e6-96231b3b80d8
      4b6ad142
Loading