summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/nullptr.cpp
AgeCommit message (Collapse)Author
2025-04-28[CodeGen] Fix handling of nullptr in initializers (#137364)Alexander Kornienko
Fixes https://github.com/llvm/llvm-project/issues/137276.
2024-07-16[clang][Interp] Allow ltor casts for null pointersTimm Bäder
We can't read from them but we special-case them later.
2022-10-06[CodeGenCXX] Convert some tests to opaque pointers (NFC)Nikita Popov
Conversion done using the script at https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34. These are tests where the conversion worked out of the box and no manual fixup was performed.
2022-04-07[OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)Nikita Popov
This adds -no-opaque-pointers to clang tests whose output will change when opaque pointers are enabled by default. This is intended to be part of the migration approach described in https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9. The patch has been produced by replacing %clang_cc1 with %clang_cc1 -no-opaque-pointers for tests that fail with opaque pointers enabled. Worth noting that this doesn't cover all tests, there's a remaining ~40 tests not using %clang_cc1 that will need a followup change. Differential Revision: https://reviews.llvm.org/D123115
2020-02-11CWG1423: don't permit implicit conversion of nullptr_t to bool.Richard Smith
The C++ rules briefly allowed this, but the rule changed nearly 10 years ago and we never updated our implementation to match. However, we've warned on this by default for a long time, and no other compiler accepts (even as an extension).
2019-06-14PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of typeRichard Smith
nullptr_t does not access memory. We now reuse CK_NullToPointer to represent a conversion from a glvalue of type nullptr_t to a prvalue of nullptr_t where necessary. This reinstates r363337, reverted in r363352. llvm-svn: 363429
2019-06-14Revert 363295, it caused PR42276. Also revert follow-ups 363337, 363340.Nico Weber
Revert 363340 "Remove unused SK_LValueToRValue initialization step." Revert 363337 "PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type" Revert 363295 "C++ DR712 and others: handle non-odr-use resulting from an lvalue-to-rvalue conversion applied to a member access or similar not-quite-trivial lvalue expression." llvm-svn: 363352
2019-06-13PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of typeRichard Smith
nullptr_t does not access memory. We now reuse CK_NullToPointer to represent a conversion from a glvalue of type nullptr_t to a prvalue of nullptr_t where necessary. This reinstates r345562, reverted in r346065, now that CodeGen's handling of non-odr-used variables has been fixed. llvm-svn: 363337
2018-11-03Revert r345562: "PR23833, DR2140: an lvalue-to-rvalue conversion on a ↵Richard Smith
glvalue of type" This exposes a (known) CodeGen bug: it can't cope with emitting lvalue expressions that denote non-odr-used but usable-in-constant-expression variables. See PR39528 for a testcase. Reverted for now until that issue can be fixed. llvm-svn: 346065
2018-10-30PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of typeRichard Smith
nullptr_t does not access memory. We now reuse CK_NullToPointer to represent a conversion from a glvalue of type nullptr_t to a prvalue of nullptr_t where necessary. llvm-svn: 345562
2011-10-13Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith
-std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
2010-12-21add missing newlines at end of file.Chris Lattner
llvm-svn: 122309
2010-11-04Pass a -I flag when compiling nullptr.cpp so the typeinfo header can be ↵Anders Carlsson
found. This should fix the errors seen on the bot. llvm-svn: 118246
2010-11-04std::nullptr_t is a fundamental type for RTTI purposes.Anders Carlsson
llvm-svn: 118238
2010-03-07Perform overload resolution when static_cast'ing from aDouglas Gregor
pointer-to-member-to-derived to a pointer-to-member-to-base. Fixes PR6072. llvm-svn: 97923
2009-12-15Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar
- This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
2009-09-15Codegen support for nullptr from C++0x.Anders Carlsson
llvm-svn: 81835