[all-commits] [llvm/llvm-project] 4bd230: [clang][ExprConst] Don't diagnose a non-existent i...

Timm Baeder via All-commits all-commits at lists.llvm.org
Tue Jan 28 06:05:08 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4bd2307a2085f0ace05e0b1b11c1c47ff3870110
      https://github.com/llvm/llvm-project/commit/4bd2307a2085f0ace05e0b1b11c1c47ff3870110
  Author: Timm Baeder <tbaeder at redhat.com>
  Date:   2025-01-28 (Tue, 28 Jan 2025)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaCXX/constant-expression-p2280r4.cpp

  Log Message:
  -----------
  [clang][ExprConst] Don't diagnose a non-existent init as not constant (#124575)

This test:
```c++
extern Swim& trident; // expected-note {{declared here}}

constexpr auto& gallagher = typeid(trident);    // expected-error {{constexpr variable 'gallagher' must be initialized by a constant expression}}
                                                // expected-note at -1 {{initializer of 'trident' is not a constant expression}}
```
diagnosed the initializer of `trident` as not constant, but `trident`
doesn't even have an initializer. Remove that diagnostic in this case.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list