diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
commit | 1928da94b55683957759d5c5ff4593a118773394 (patch) | |
tree | 48b44512b5db8ced345df4a1a56b5065cf2a14d9 /test/SemaCXX/conditional-expr.cpp | |
parent | 53992adde3eda3ccf9da63bc7e45673f043de18f (diff) | |
download | FreeBSD-src-1928da94b55683957759d5c5ff4593a118773394.zip FreeBSD-src-1928da94b55683957759d5c5ff4593a118773394.tar.gz |
Update clang to r108243.
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r-- | test/SemaCXX/conditional-expr.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index a09ff2b..f37ccc8 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -199,17 +199,24 @@ void test() } namespace PR6595 { + struct OtherString { + OtherString(); + OtherString(const char*); + }; + struct String { String(const char *); + String(const OtherString&); operator const char*() const; }; - void f(bool Cond, String S) { + void f(bool Cond, String S, OtherString OS) { (void)(Cond? S : ""); (void)(Cond? "" : S); const char a[1] = {'a'}; (void)(Cond? S : a); (void)(Cond? a : S); + (void)(Cond? OS : S); } } @@ -275,3 +282,25 @@ namespace rdar7998817 { : X()); } } + +namespace PR7598 { + enum Enum { + v = 1, + }; + + const Enum g() { // expected-warning{{type qualifier on return type has no effect}} + return v; + } + + const volatile Enum g2() { // expected-warning{{'const volatile' type qualifiers on return type have no effect}} + return v; + } + + void f() { + const Enum v2 = v; + Enum e = false ? g() : v; + Enum e2 = false ? v2 : v; + Enum e3 = false ? g2() : v; + } + +} |