summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/constexpr-printing.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-01-05 23:59:40 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-01-05 23:59:40 +0000
commitb1bc368ca7950eddd7fd3da69050ac260bd68dcf (patch)
treeac328ccae220cb5b33d4dc76a2b7add73d0b532d /clang/test/SemaCXX/constexpr-printing.cpp
parent5ab9c0a9270d34b8f7b2eee600b47a62dadf82c0 (diff)
downloadbcm5719-llvm-b1bc368ca7950eddd7fd3da69050ac260bd68dcf.tar.gz
bcm5719-llvm-b1bc368ca7950eddd7fd3da69050ac260bd68dcf.zip
Address Richard's review comments on r147561 (Evaluate support for address-of-label differences).
llvm-svn: 147631
Diffstat (limited to 'clang/test/SemaCXX/constexpr-printing.cpp')
-rw-r--r--clang/test/SemaCXX/constexpr-printing.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/constexpr-printing.cpp b/clang/test/SemaCXX/constexpr-printing.cpp
index 03768c09fb9..2e0eb9c23d1 100644
--- a/clang/test/SemaCXX/constexpr-printing.cpp
+++ b/clang/test/SemaCXX/constexpr-printing.cpp
@@ -89,3 +89,10 @@ constexpr wchar_t wc = get(L"test\0\\\"\t\a\b\234\u1234"); // \
expected-error {{}} expected-note {{L"test\000\\\"\t\a\b\234\u1234"}}
constexpr char32_t c32_err = get(U"\U00110000"); // expected-error {{invalid universal character}}
+
+typedef decltype(sizeof(int)) LabelDiffTy;
+constexpr LabelDiffTy mulBy3(LabelDiffTy x) { return x * 3; } // expected-note {{subexpression}}
+void LabelDiffTest() {
+ static_assert(mulBy3((LabelDiffTy)&&a-(LabelDiffTy)&&b) == 3, ""); // expected-error {{constant expression}} expected-note {{call to 'mulBy3(&&a - &&b)'}}
+ a:b:return;
+}
OpenPOWER on IntegriCloud