view clang/test/CodeGenCXX/conditional-expr-lvalue.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children
line wrap: on
line source

// RUN: %clang_cc1 -emit-llvm-only %s
void f(bool flag) {
  int a = 1;
  int b = 2;
  
  (flag ? a : b) = 3;
}

// PR10756
namespace test0 {
  struct A {
    A(const A &);
    A &operator=(const A &);
    A sub() const;
    void foo() const;
  };
  void foo(bool cond, const A &a) {
    (cond ? a : a.sub()).foo();
  }
}