summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-07-08 23:35:04 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-07-08 23:35:04 +0000
commit544c956b72e4ea78de4c8b096af7793838af975b (patch)
tree124425cf5164fa63ce645b2ed81b1a10315c25cc /clang
parentc9c57518abc2aa410121915e34887ab1635a988b (diff)
downloadbcm5719-llvm-544c956b72e4ea78de4c8b096af7793838af975b.tar.gz
bcm5719-llvm-544c956b72e4ea78de4c8b096af7793838af975b.zip
Fix crash typo-correcting dependent member func.
PR16561. llvm-svn: 185887
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/Sema.cpp2
-rw-r--r--clang/test/SemaCXX/addr-of-overloaded-function.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 3ddce77a883..e55e128daef 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -1187,7 +1187,7 @@ bool Sema::tryExprAsCall(Expr &E, QualType &ZeroArgCallReturnTy,
// Attempt to call the member with no arguments - this will correctly handle
// member templates with defaults/deduction of template arguments, overloads
// with default arguments, etc.
- if (IsMemExpr) {
+ if (IsMemExpr && !E.isTypeDependent()) {
bool Suppress = getDiagnostics().getSuppressAllDiagnostics();
getDiagnostics().setSuppressAllDiagnostics(true);
ExprResult R = BuildCallToMemberFunction(NULL, &E, SourceLocation(), None,
diff --git a/clang/test/SemaCXX/addr-of-overloaded-function.cpp b/clang/test/SemaCXX/addr-of-overloaded-function.cpp
index 3d007a9612a..230a1eb994e 100644
--- a/clang/test/SemaCXX/addr-of-overloaded-function.cpp
+++ b/clang/test/SemaCXX/addr-of-overloaded-function.cpp
@@ -235,3 +235,7 @@ namespace test1 {
void (Qualifiers::*X)() = &Dummy::N; // expected-error{{cannot initialize a variable of type 'void (test1::Qualifiers::*)()' with an rvalue of type 'void (test1::Dummy::*)()': different classes ('test1::Qualifiers' vs 'test1::Dummy')}}
}
+
+template <typename T> class PR16561 {
+ virtual bool f() { if (f) {} return false; } // expected-error {{reference to non-static member function must be called}}
+};
OpenPOWER on IntegriCloud