[PATCH] D84032: [clang] Make clear Sema::CheckForConstantInitializer is for C-only codepath.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 17 10:55:20 PDT 2020


hokein planned changes to this revision.
hokein marked an inline comment as done.
hokein added inline comments.


================
Comment at: clang/test/SemaCXX/compound-literal.cpp:92
 
-// This doesn't necessarily need to be an error, but CodeGen can't handle it
-// at the moment.
-int PR17415 = (int){PR17415}; // expected-error {{initializer element is not a compile-time constant}}
+int PR17415 = (int){PR17415}; // expected-warning {{variable 'PR17415' is uninitialized when used within its own initialization}}
 
----------------
hmm, clang will crash at CodeGen again if we turn off the `-Wuninitialized` warning.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84032/new/

https://reviews.llvm.org/D84032





More information about the cfe-commits mailing list