From b9272af8c8bde73503a2a7ebf77427c9c09797a8 Mon Sep 17 00:00:00 2001 From: Laszlo Nagy Date: Sun, 4 Aug 2013 23:11:45 +0200 Subject: [PATCH] add test for bug #21 --- test/PseudoConstAnalysis/Bug21.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/PseudoConstAnalysis/Bug21.cpp diff --git a/test/PseudoConstAnalysis/Bug21.cpp b/test/PseudoConstAnalysis/Bug21.cpp new file mode 100644 index 0000000..a63d15b --- /dev/null +++ b/test/PseudoConstAnalysis/Bug21.cpp @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 %s -fsyntax-only -verify +// expected-no-diagnostics + +struct B { + int member; + + int mutator() { + ++member; + return member; + } + + int const_logic(int const arg) const { + return arg + member; + } + + int test() { + return const_logic(mutator()); + } +};