diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-07-30 16:41:40 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-07-30 16:41:40 +0000 |
| commit | e3895eb050152f77a3ad7023cee5b0b070e52e7b (patch) | |
| tree | 5fe7575ec0bc5a829abe1a9aa556975074a75e6d /clang/test/SemaCXX/cxx98-compat.cpp | |
| parent | bc7dd9ea027a6c33004a56dad1423112ed6a9463 (diff) | |
| download | bcm5719-llvm-e3895eb050152f77a3ad7023cee5b0b070e52e7b.tar.gz bcm5719-llvm-e3895eb050152f77a3ad7023cee5b0b070e52e7b.zip | |
Use the location of the copy assignment when diagnosing classes that are nontrivial because of it.
llvm-svn: 160962
Diffstat (limited to 'clang/test/SemaCXX/cxx98-compat.cpp')
| -rw-r--r-- | clang/test/SemaCXX/cxx98-compat.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp index 9bd854a6645..37341f88561 100644 --- a/clang/test/SemaCXX/cxx98-compat.cpp +++ b/clang/test/SemaCXX/cxx98-compat.cpp @@ -346,3 +346,19 @@ namespace PR13480 { basic_iterator it; // expected-warning {{union member 'it' with a non-trivial copy constructor is incompatible with C++98}} }; } + +namespace AssignOpUnion { + struct a { + void operator=(const a &it) {} + void operator=(a &it) {} // expected-note {{because type 'AssignOpUnion::a' has a user-declared copy assignment operator}} + }; + + struct b { + void operator=(const b &it) {} // expected-note {{because type 'AssignOpUnion::b' has a user-declared copy assignment operator}} + }; + + union test1 { + a x; // expected-warning {{union member 'x' with a non-trivial copy assignment operator is incompatible with C++98}} + b y; // expected-warning {{union member 'y' with a non-trivial copy assignment operator is incompatible with C++98}} + }; +} |

